douyong5825 2014-05-21 05:05
浏览 87

ADODB + php不会在Oracle中存储西班牙语字符

I am using Spanish characters in my application. Currently I am storing Spanish accents like this in to database

 é í ó útestestet 

If I am using query from database like this

UPDATE indi_cmi_unidad
    SET 
        nombre='Oscar:Oscar: Oscar:    é í ó ú',
        factor='0',
        indi_unidad_base='',
        abreviatura='tc'
    WHERE idunidad='3'

Then it is Okey it will save this charactersenter image description here

But when I am passing this query from ADODB + PHP, then it is reflecting special character in database like,

enter image description here

I tried a lot I also put this query in my constructor class of adodb

$sql = "ALTER SESSION SET NSL_CHARACTERSET = 'US7ASCII'";

But not getting any result. Please help me

Thanks & Regards

  • 写回答

1条回答 默认 最新

  • doushaiyu5065 2014-06-24 12:27
    关注

    Do you set the correct charset on the connection to the database ?

    http://www.php.net//manual/es/function.oci-connect.php

    Check the character_set parameter.

    Something like this should work:

    $connection = oci_connect(DB_USER, DB_PASS, DB_CONN_STRING, 'WE8ISO8859P15');
                                                                ^^^^^^^^^^^^^^^
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝