bruno_boccara
asked on
charset encode: accent problem with MSSQL2008 / PHP5.3.4 / Apache 2.2 and PDO_SQLSRV Driver 2.0
Hello,
I just upgrade to PHP5.3.4/Apache2.2 and MSSQL 2008
I have problem of accent from data that I retrieve from the DB.
the charset encode of the site is iso-8859-1 (and accent from html code are displayed normally)
the charset encode of the DB is FENCH_CI_AS
I saw in many forum that we should define the charset of the DB when connecting to it from PHP but I didn't find the good syntax.....
thanks for your help
I just upgrade to PHP5.3.4/Apache2.2 and MSSQL 2008
I have problem of accent from data that I retrieve from the DB.
the charset encode of the site is iso-8859-1 (and accent from html code are displayed normally)
the charset encode of the DB is FENCH_CI_AS
I saw in many forum that we should define the charset of the DB when connecting to it from PHP but I didn't find the good syntax.....
thanks for your help
ASKER
With PDO_SQLSRV Driver, there is no mssql.charset .
mssql library do not work anymore with PHP 5.3.4
PDO_SQLSERV 2.0 is the new library that replace it.
I saw in php site that we could include the charset during the connection but when I try to do this, it doesn't work...(could not connect to server).
http://php.net/manual/en/book.pdo.php
<?php
$db = new PDO('dblib:host=your_hostn ame;dbname =your_db;c harset=UTF -8', $user, $pass);
?>
is this because I try to make the DB in utf-8 and the DB charset is french_ci_as ?.
I'm searching for 2 days......getting crazy...
mssql library do not work anymore with PHP 5.3.4
PDO_SQLSERV 2.0 is the new library that replace it.
I saw in php site that we could include the charset during the connection but when I try to do this, it doesn't work...(could not connect to server).
http://php.net/manual/en/book.pdo.php
<?php
$db = new PDO('dblib:host=your_hostn
?>
is this because I try to make the DB in utf-8 and the DB charset is french_ci_as ?.
I'm searching for 2 days......getting crazy...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i'm glad you've solved the problem.
ASKER
thank you.
ASKER
I found by myself the solution.....
thanks to jet-black for his help.
thanks to jet-black for his help.
if it doesn't helps, you can check this:
http://bytes.com/topic/php/answers/448923-php5-mssql-utf-8-problem#post1719221