php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35493 mssql_query return values varies from version to version (works with PHP 5.1)
Submitted: 2005-11-30 16:53 UTC Modified: 2005-12-08 01:00 UTC
From: martin at malditainternet dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.4.1 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-11-30 16:53 UTC] martin at malditainternet dot com
Description:
------------
The return value of mssql_query is different from version to version when there aren't rows to return. For example:

PHP: 4.4.2RC2-dev (from snap)
Query (select * from sysobjects where name='nonexistant') ret: 5

PHP: 5.0.5-3 (Debian)
Query (select * from sysobjects where name='nonexistant') ret: Resource id #5

PHP: 4.4.1-0.dotdeb.3 (Debian - Dotdeb)
Query (select * from sysobjects where name='nonexistant') ret: 1

PHP: 4.4.0-4 (Debian)
Query (select * from sysobjects where name='nonexistant') ret: Resource id #5


Reproduce code:
---------------
<?
mssql_connect('HOST','USER','password'); mssql_select_db('TNS_1_3_SPIDER');

$q="select * from sysobjects where name='nonexistant'";
print 'PHP: '.phpversion()."\n"."Query ($q) ret: ".mssql_query($q)."\n";
?>


Expected result:
----------------
I would love to get 'Resources' instead of integers


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-30 20:46 UTC] fmk@php.net
Please check that you are using the same version (and protocol) of FreeTDS on all the different systems.

This is the output with the latest CVS version of both FreeTDS and PHP:

PHP: 5.1.0RC5-dev
Query (select * from sysobjects where name='nonexistant') ret: Resource id #5


 [2005-12-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 14:04:16 2022 UTC