php向oracle里写入中文记录

来源:百度知道 编辑:UC知道 时间:2024/05/25 14:38:34
php向oracle里写入中文记录,总是写不进去,如:
$name='张三';
$query="insert into table1(name) values('$name')";
$stmt=oci_parse($handle,$query);........
提示的错误就是,引号内的字符不能正常结束。
就是不能正常插入记录,详细问一下php怎么向oracle插入中文记录,需要做什么设置?

$name=str_replace("'", "\\'", $name);
$name=str_replace(""", "\\"", $name);

把中文字符里面的引号替换一下试试看。,

语句错误
$query="insert into table1(name) values('".$name."')";