开发者

why MSSQL SERVER return question marks, when I execute query in PHP?

My Databese server is MSSQL SERVER and I connect to it with PHP's PDO class, connection is successful but when I execute query I receive question marks for all text type fields.

I have "UTF-8" in HTML Charset, My database collation is "Latin1_General_BIN" and fields type is nvarchar(50).

If you have some solition for this p开发者_StackOverflow社区roblem, please reply.


I serched around and found a post on php.net.

Maybe this can help (from http://php.net/manual/en/book.pdo.php#98659 )

This works to get UTF8 data from MSSQL:

<?php
$db = new PDO('dblib:host=your_hostname;dbname=your_db;charset=UTF-8', $user, $pass);
?>

You can try using different charset arguments to see if any works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜