Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all articles
Browse latest Browse all 391

Sql Server

$
0
0

This application, “eChamber”, uses a framework that is based on the ORM for PHP: doctrine 1.2.6 inspired by nHibernate. Furthermore, the framework is only compatible with php 5.3 and higher. When used with Oracle and MySQL, the application faces no problem and we are able to switch seamlessly from one RBDMS to another.

But when we have tried to switch to SQL Server 2008 nothing works. We are facing a lot of issues, themost important are:

  • Doctrine 1.2.6 doesn´t support the new Microsoft Driver and PHP 5.3 doesn´t support the old driver (mssql) any more.
  • We haven´t been able to run the doctrine functions: build task with our existing object models
  • We haven´t been able to execute complex SQL queries: as double left join, renaming results, etc.
  • Problems using UTF-8 encoding on data. The data loaded from Web Application is encoded incorrectly when loaded to the database. This is because the whole application is encoded in UTF-8 and the database Ms-SQL is expecting UCS-2. Indeed for ‘nvarchar’ types, Ms-SQL Server always uses UCS-2 encoding to store the data no matter which collation we use.

 

None of ourworkaround solutions worked inspired by Ms kb-232580:

1-    Using PHP 5.3.x and new driver: not working namely, Ms-SQL database is not reachable for our new application.

 

2-    Using PHP 5.3.x and ODBC has 2 issues :

  • Too frequently we have the following error:

SQLSTATE[25000]: Invalid transaction state: 3902 [Microsoft][ODBC SQL Server Driver][SQL Server]The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. (SQLExecDirect[3902] at ext\pdo_odbc\odbc_driver.c:247)

The workaround would be to manually simplify the queries. However, this is an inconvenience, to say the least, because we have a lot of complex queries. Furthermore, we think it is inacceptable to overcome this issue with changes in php code and object models.

  • Application collation (UTF8) vs Ms-SQL collation (UCS-2): Application must use UTF8 encoding for these reasons: framework UTF8 full compatible (i18n, pdf generator, xml exchange, ORM …), bank exchange must be in utf8. But Ms-SQL doesn’t support UTF8 encoding for Unicode data, Arabic in our case. Since we are using a Framework and an ORM, no collation conversion can be done: neither on apache side when sending form (via GET or POST), nor before displaying these data (like using <% Session.Codepage=65001 %>).

 

3-    Using PHP 5.2.11 and old driver (mssql) has at least 2 critical non-working library:

  • Security module (login/password),
  • Quotation and billing modules,
  • Etc.

 

Consequently, we are looking for a solution to handle easily and seamlessly UTF8 data (and more especially Arabic letter) with Microsoft Ms-SQL server 2008 R2 and we would appreciate your suggestions to address the issues mentioned above.




Viewing all articles
Browse latest Browse all 391

Trending Articles