php通过odbc用sql语句查询时无法查询中文,应该怎么转码?

WBOY
Release: 2016-06-02 11:34:56
Original
1710 people have browsed it

phpsql乱码informix

数据库是informix,编码是iso-8859-1,php编码是gbk。从网上找了各种方式转换,都不行。
代码如下,其中$licenseno是车牌号,中间有省份缩写是汉字。

<code>$sql.="and b.licenseno = \"".$licenseno."\"";</code>
Copy after login

会返回错误如下:

<code>Warning: odbc_exec() [function.odbc-exec]: SQL error: [Informix][Informix ODBC Driver]Inexact character conversion during translation., SQL state S1000 in SQLExecDirect in D:\wamp\www\chaxun\chaxun.php on line 79</code>
Copy after login

请问应该怎么做?谢谢

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!