当引入ADODB作为PHP的数据库访问层的时候,查询数据库用浏览器显示是正确的,当用Zend Studio调试的时候,发现总是乱码,原来以为Zend Studio的中文乱码问题,结果发现原来是Adodb的问题,用的是adodb_lite1.42的版本,为了防止中文乱码???的产生,在adodbSQL_drivers\mysql\mysql_driver.inc文件中添加一行修改如下:
@mysql_query(“SET NAMES ‘utf8′”, $this->connectionId);
if ($this->connectionId === false)
{
if ($fn = $this->raiseErrorFn)
$fn($this->dbtype, ‘CONNECT’, $this->ErrorNo(), $this->ErrorMsg(), $this->host, $this->database, $this);
return false;
}
备查!



