From: martin at malditainternet dot com Operating system: linux PHP version: 4.4.1 PHP Bug Type: MSSQL related Bug description: mssql_query return values varies from version to version
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 -- Edit bug report at http://bugs.php.net/?id=35493&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35493&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35493&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35493&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35493&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35493&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35493&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35493&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35493&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35493&r=support Expected behavior: http://bugs.php.net/fix.php?id=35493&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35493&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35493&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35493&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35493&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35493&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35493&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35493&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35493&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35493&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35493&r=mysqlcfg