Utf 8 adodb setConnectionParameter字符集

Utf 8 adodb setConnectionParameter字符集,utf-8,adodb-php,character-set,Utf 8,Adodb Php,Character Set,在adodb中如何使用以下代码 “字符集”、“UTF-8”放在哪里 受保护的$connectionParameters=数组 /** * Adds a parameter to the connection string. * * These parameters are added to the connection string when connecting, * if the driver is coded to use it. * * @param string $parame

在adodb中如何使用以下代码

“字符集”、“UTF-8”放在哪里

受保护的$connectionParameters=数组

/**
* Adds a parameter to the connection string.
*
* These parameters are added to the connection string when connecting,
* if the driver is coded to use it.
*
* @param    string  $parameter  The name of the parameter to set
* @param    string  $value      The value of the parameter
*
* @return null
*
* @example, for mssqlnative driver ('CharacterSet','UTF-8')
*/

    final public function setConnectionParameter($parameter,$value)
{

    $this->connectionParameters[$parameter] = $value;

}

在创建ADOdb对象之后,但在连接到数据库之前设置它

$db = newADOConnection('mssqlnative');
$db->setConnectionParameter('CharacterSet', 'UTF-8');
$db->connect($host, $user, $password, $database);

“CharacterSet”不适用于mysqli

正确的一点:

$db->setConnectionParameter(MYSQLI_SET_CHARSET_NAME, 'utf8');
注意输入错误-字符集应该是CharacterSet,UTF8可能需要是UTF-8。