ID: 29292 User updated by: jmelville at selectaustralasia dot com dot au Reported By: jmelville at selectaustralasia dot com dot au Status: Bogus Bug Type: MSSQL related Operating System: Windows 2000 Server SP4 PHP Version: 4.3.8 New Comment:
I'm the original submitter, and just wanted to note that if you switch to using the PHP ADODB library from http://adodb.sourceforge.net/ you can choose several more up-to-date methods of connecting to SQL Server (e.g. via an OLEDB provider) that don't involve using the old ntwdblib.dll file and don't expose related bugs and limitations (such as the 256 character VARCHAR limit on SELECT). Works well with PHP5 too. Previous Comments: ------------------------------------------------------------------------ [2004-10-20 16:16:19] nestoru at yahoo dot com This is clearly a bug in mssql dll. The sp_dbcmptlevel change the way an empty string is stored in sql but it has nothing to do with the fact that even a field that has not been updated with empty string still "is seen" as a single character by the mssql library. If you use ADO from VB, VC etc you get empty string. If you run from Query Analyzer |select 'x' + field + 'x' from table| you get |xx| not |x x| as mssql is returning. I am using PHP5 MSSQL2000 and the code is not working as it was with PHP4.0.6 and MSSQL97. Any help will be apreciated. Thanks ------------------------------------------------------------------------ [2004-10-19 11:16:53] phopfgartner at tin dot it Have you checked that the database is has a compatibility level >= 70? (see sp_dbcmptlevel) Peter ------------------------------------------------------------------------ [2004-09-22 23:02:00] ohalloran at enterasys dot com I too have the same problem when upgrading to 4.3.8. I did notice that using PEAR:DB functions the problem not longer happens. ------------------------------------------------------------------------ [2004-09-22 20:34:01] w dot peereboom at jkz-rkz dot nl If have installed php version 4.3.8 and 5.0 but with both versions some sort of the same problem is comming up. When i select all records from a View stored in MS SQL 2000 ("SELECT * FROM View_name) i get all the records while the view on SQL server is definied as SELECT * FROM Table WHERE field IS NOT NULL. When i run this last query in my query analyser the result is less records then when i start the view query with my php application. I think this has something to do with this same problem. Winfred ------------------------------------------------------------------------ [2004-09-22 01:56:25] jmelville at selectaustralasia dot com dot au > in the bottom line make sure php > use updated ntwdblib.dll file. Thanks momo. I've read #25777 and I understand that there are problems with PHP using older libraries to talk to SQL Server. I have ntwdblib.dll versions 7.00.839 (this is the one that ships with PHP including 4.3.9RC3) and 8.00.194 (which comes with SQL 2000) and the problem described in this bug shows up with both those libs. Is there an even newer version that I should be using? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29292 -- Edit this bug report at http://bugs.php.net/?id=29292&edit=1