php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24225 With Fastcgi, mssql_fetch_array and mssql_fetch_row return wrong character 152
Submitted: 2003-06-17 09:40 UTC Modified: 2003-06-18 01:47 UTC
From: lim at liones dot nl Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.2 OS: Win2000
Private report: No CVE-ID: None
 [2003-06-17 09:40 UTC] lim at liones dot nl
Description:
------------
In combination with fastcgi mssql_fetch_array and mssql_fetch_row gives all characters ? ( chr(255) ) as ~ ( chr(152). This happens only when fastcgi is turned on. 
These characters are stored in a MS SQL Server 2000 database in a varchar field. 

Reproduce code:
---------------
First store a ? character in a varchar field in MS SQL Server 2000

mssql_connect( 'sqlserver,'username', 'password');
	
$result = mssql_query( "SELECT TOP 1 * FROM yourtable" );
	
print_r( mssql_fetch_array( $result ) );
	


Expected result:
----------------
correct result:
[0] => ?


Actual result:
--------------
returned result:
[0] => ~

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-17 10:47 UTC] fmk@php.net
The MSSQL Server client tools are "smart" and try to detect the code page the client is using. If the server is accessed from the command line you will get different results from the same query used as CGI under IIS or another web server. If you are getting different results from CGI and FastCGI, I would say it's a problem with FastCGI.

You can try to change the setting of 'Automatic ANSI to OEM convertion' under DB-Library options in the Client Network Utility application. You should change this parameter on the client computer!
 [2003-06-18 01:47 UTC] lim at liones dot nl
Thanks. You are right.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC