2017-03-25 23 views
0

どのようにadodbで次のコードを使用しますか?adodb setConnectionParameter CharacterSet

「 'CharacterSet'、 'UTF-8'」はどこに配置しますか?

protected $ connectionParameters = array();

/** 
* 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; 

} 

答えて

0

ADOdbオブジェクトを作成した後で、データベースに接続する前に設定します。

$db = newADOConnection('mssqlnative'); 
$db->setConnectionParameter('ChearaterSet','UTF8'); 
$db->connect($host,$user,$password,$database);