Connecting with SQL Server: mssql_ or sqlsrv_ ?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ladbike
Forum Newbie
Posts: 2
Joined: Thu Sep 17, 2009 9:48 am

Connecting with SQL Server: mssql_ or sqlsrv_ ?

Post by ladbike »

Hi,
I am just getting started writing an application in PHP that interacts with a SQL Server database. The administrator of the system installed PHP with mssql_ functions enabled. They work perfectly, but we cannot get UTF-8 characters to display properly.
He has abandoned this setup and installed SQL Server Driver for PHP 1.1. Now I have to study sqlsrv_ functions and rewrite what I have. That is fine, but I am not confident I am heading down the right path. I would much prefer to stick with the php than go to MS.
Is the unicode problem related to the mssql_ functions, or is there another problem the administrator is missing? Is Microsoft's driver worth working with?
Thanks!
Brian Swan
Forum Newbie
Posts: 17
Joined: Thu Jan 14, 2010 11:56 am

Re: Connecting with SQL Server: mssql_ or sqlsrv_ ?

Post by Brian Swan »

I'm not sure if mssql supports UTF-8, so I can't say if your admin is missing something or if its the driver that is the problem. Have you tried using iconv (http://us3.php.net/manual/en/function.iconv.php)? I do know that Microsoft added native UTF-8 support in their most recent release of their driver (sqlsrv v1.1). This describes how to use that feature: http://msdn.microsoft.com/en-us/library ... L.90).aspx

Hope that helps.
-Brian
ladbike
Forum Newbie
Posts: 2
Joined: Thu Sep 17, 2009 9:48 am

Re: Connecting with SQL Server: mssql_ or sqlsrv_ ?

Post by ladbike »

I have been working with the sqlsrv functions. They are working just fine. I am keeping all these functions in one place in case I need to change again.

Thanks!
Post Reply