如何在adodb中使用以下代码?
"'CharacterSet ',‘UTF-8'“放在哪里?
protected $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;
}发布于 2017-04-21 23:01:21
在创建ADOdb对象之后,但在连接到数据库之前设置它。
$db = newADOConnection('mssqlnative');
$db->setConnectionParameter('CharacterSet', 'UTF-8');
$db->connect($host, $user, $password, $database);发布于 2021-02-12 03:16:14
'CharacterSet‘不适用于mysqli。
更正一条:
$db->setConnectionParameter(MYSQLI_SET_CHARSET_NAME, 'utf8');https://stackoverflow.com/questions/43015519
复制相似问题