#26835 [Opn->Fbk]: wrong data type returned by mssql_fetch_array
| From: | fmk@php.net | Date: | Thu, 08 Jan 2004 06:07:37 +0000 |
| Subject: | #26835 [Opn->Fbk]: wrong data type returned by mssql_fetch_array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52969@lists.php.net to get a copy of this message | ||
ID: 26835
Updated by: fmk@php.net
Reported By: skissane at ics dot mq dot edu dot au
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Solaris 2.6
PHP Version: 4.3.4
New Comment:
This seams to be a problem on Solaris or FreeTDS. I've tested the code
on Linux and Win32 and can't reproduce the problem.
The code is designed to return NULL if the db-api returns zero length
data. For some reson NULL bust be translated into a non zero length
value on Solaris.
Previous Comments:
------------------------------------------------------------------------
[2004-01-07 22:17:35] skissane at ics dot mq dot edu dot au
Description:
------------
The following script returns an empty string on Solaris, when it should
return a NULL (which it does, correctly, on Linux.)
This is using FreeTDS 0.61.2 (same problem occurs with FreeTDS 0.52).
This is talking to a SQL Server 2000 using TDS version 7.0 (switching
to 8.0 made no difference).
I've checked, and:
mssql.compatability_mode = Off
in php.ini.
Reproduce code:
---------------
<?
$id =
mssql_connect("<servername>","<username>","<password>");
$q = mssql_query("SELECT NULL",$id);
$f = mssql_fetch_array($q);
echo gettype($f[0]);
Expected result:
----------------
NULL
Actual result:
--------------
string
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26835&edit=1