如何使用php在sql server中使用pdo插入数据?

时间:2015-02-05 10:12:10

标签: php sql-server pdo

我使用pdo语句插入数据,它抛出了异常:

PHP Fatal error:  Uncaught exception 'PDOException' with message 
'SQLSTATE[IMSSP]: An error occurred translating string for input param 11 to 
UCS-2: No mapping for the Unicode character exists in the target multi-byte 
code page.

我的输入参数11值如下:abc, 84*, xxx 750 yy. ~ $114.0000 , I thought exception with '*' in it's value .

如何解决这个异常,任何人都可以帮助我吗?

我的插入pdo语句格式如fallow:

$insert2 =$dbh->prepare("INSERT INTO tablename(column1, column2, column3, 
column4, column5, column6, column7, column8, column9, column10, column11, 
column12) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");

$insert2->execute(array($value1,$value2,$value3,$value4,$value5,$value6,
$value7,$value8,$value9,$value10,$value11,$value12));

先谢谢

0 个答案:

没有答案