#24720 [Bgs]: mysql_result(): supplied argument is not a valid MySQL result resource
ID: 24720 User updated by: adrian at smartcall dot ro Reported By: adrian at smartcall dot ro Status: Bogus Bug Type: MSSQL related Operating System: linux slackware PHP Version: 4.3.2 New Comment: I have also the corect result when I run SQSH/FreeTDS. Still in php the problem persist, I didn't found a way to solve it ! Previous Comments: [2004-01-16 14:12:57] savelazquez at megacable dot com dot mx I have the same problem on FreeBSD, I think this is a bug, and is not related to the O.S. I reproduced the same querys that PHP/FreeTDS fails to execute in SQSH/FreeTDS and they run fine. The problem presents when no records are found in the query using PHP/FreeTDS. [2003-07-24 09:27:27] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php I unable to test mssql, however the test code does work correctly unless the query you execute is faulty. For example if you perform a select on a non-existant field the error that occurs when mysql_fetch_row() is called is identical to the one you describe. Which leads me to believe the error is the result of a bad query and not a behavioural change in PHP. [2003-07-21 06:12:34] adrian at smartcall dot ro I downloaded the latest snapshot ... compiled, instaled ... but with no success ... the result is still the same for mssql_query or mysql_query: When my query has no match I get 1 as result instead of a resurce id. Now I am writting myscripts this way : if ( $result != 1 ) while ($msrow = mssql_fetch_row($result)) { ... etc ... } But I don't think this is very elegant. P.S. Before I installed the slackware on the server I had a debian ( woody ), on which I had the same problem. So, is not a operating system problem ! [2003-07-20 10:47:53] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip And give a complete example script, WITHOUT any 'include/require' calls. [2003-07-19 14:48:53] adrian at smartcall dot ro Description: I updated my php to php-4.3.2 on apache_1.3.27, I have mysql-3.23.57 and I also use freetds-0.61. My php ./configure line is './configure' '--prefix=/usr/local/misc/php' '--with-apxs=/usr/local/misc/apache/bin/apxs' '--with-mysql=/usr/local/misc/mysql' '--with-sybase-ct=/usr/local/misc/freetds' All my scripts ( that before worked ) are giveing me the followig error : Warning: mysql_result(): supplied argument is not a valid MySQL result resource mssql_fetch_row(): supplied argument is not a valid Sybase result resource This error apears when no line maches the query ! In the first place I thought that is the freetds driver ... but I saw that even on mysql i'm geting the same error. Reproduce code: --- $msdb = mssql_connect("192.168.0.5", "web","webpass"); mssql_select_db("DATABASE",$msdb); $result = mssql_query("SELECT DEALERS.PASS FROM DEALERS WHERE DEALERS.DEALER='" . $_POST["DealerName"] . "'", $msdb); $msrow = mssql_fetch_row($result); if ( $msrow[0] != $_POST["DealerPass"] ) { mssql_close($msdb); include("../include/error_message.html"); exit(); } Expected result: Warning: mssql_fetch_row(): supplied argument is not a valid Sybase result resource in /home/www/default/dealer/check_dealer.php on line 7 Actual result: -- In $msrow[0] I should have the password ( I have the password when $_POST["DealerName"] matches one of the DEALERS.DEALER from DEALERS ) but if $_POST["DealerName"] can't be found in the table I'm getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource I "echo("Result = ".$result);" and when I have a match I'm getting "Result = Resource id #7" and when not a match I have "Result = 1". Is this correct ? Before using php 4.3.2 I didn't faced this problem ! -- Edit this bug report at http://bugs.php.net/?id=24720&edit=1
#24720 [Fbk->Opn]: mysql_result(): supplied argument is not a valid MySQL result resource
ID: 24720 User updated by: adrian at smartcall dot ro Reported By: adrian at smartcall dot ro -Status: Feedback +Status: Open Bug Type: MSSQL related Operating System: linux slackware PHP Version: 4.3.2 New Comment: I downloaded the latest snapshot ... compiled, instaled ... but with no success ... the result is still the same for mssql_query or mysql_query: When my query has no match I get 1 as result instead of a resurce id. Now I am writting myscripts this way : if ( $result != 1 ) while ($msrow = mssql_fetch_row($result)) { ... etc ... } But I don't think this is very elegant. P.S. Before I installed the slackware on the server I had a debian ( woody ), on which I had the same problem. So, is not a operating system problem ! Previous Comments: [2003-07-20 10:47:53] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip And give a complete example script, WITHOUT any 'include/require' calls. [2003-07-19 14:48:53] adrian at smartcall dot ro Description: I updated my php to php-4.3.2 on apache_1.3.27, I have mysql-3.23.57 and I also use freetds-0.61. My php ./configure line is './configure' '--prefix=/usr/local/misc/php' '--with-apxs=/usr/local/misc/apache/bin/apxs' '--with-mysql=/usr/local/misc/mysql' '--with-sybase-ct=/usr/local/misc/freetds' All my scripts ( that before worked ) are giveing me the followig error : Warning: mysql_result(): supplied argument is not a valid MySQL result resource mssql_fetch_row(): supplied argument is not a valid Sybase result resource This error apears when no line maches the query ! In the first place I thought that is the freetds driver ... but I saw that even on mysql i'm geting the same error. Reproduce code: --- $msdb = mssql_connect("192.168.0.5", "web","webpass"); mssql_select_db("DATABASE",$msdb); $result = mssql_query("SELECT DEALERS.PASS FROM DEALERS WHERE DEALERS.DEALER='" . $_POST["DealerName"] . "'", $msdb); $msrow = mssql_fetch_row($result); if ( $msrow[0] != $_POST["DealerPass"] ) { mssql_close($msdb); include("../include/error_message.html"); exit(); } Expected result: Warning: mssql_fetch_row(): supplied argument is not a valid Sybase result resource in /home/www/default/dealer/check_dealer.php on line 7 Actual result: -- In $msrow[0] I should have the password ( I have the password when $_POST["DealerName"] matches one of the DEALERS.DEALER from DEALERS ) but if $_POST["DealerName"] can't be found in the table I'm getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource I "echo("Result = ".$result);" and when I have a match I'm getting "Result = Resource id #7" and when not a match I have "Result = 1". Is this correct ? Before using php 4.3.2 I didn't faced this problem ! -- Edit this bug report at http://bugs.php.net/?id=24720&edit=1
#24721 [NEW]: mysql_result(): supplied argument is not a valid MySQL result resource
From: adrian at smartcall dot ro Operating system: linux slackware PHP version: 4.3.2 PHP Bug Type: *Database Functions Bug description: mysql_result(): supplied argument is not a valid MySQL result resource Description: I updated my php to php-4.3.2 on apache_1.3.27, I have mysql-3.23.57 and I also use freetds-0.61. My php ./configure line is './configure' '--prefix=/usr/local/misc/php' '--with-apxs=/usr/local/misc/apache/bin/apxs' '--with-mysql=/usr/local/misc/mysql' '--with-sybase-ct=/usr/local/misc/freetds' All my scripts ( that before worked ) are giveing me the followig error : Warning: mysql_result(): supplied argument is not a valid MySQL result resource mssql_fetch_row(): supplied argument is not a valid Sybase result resource This error apears when no line maches the query ! In the first place I thought that is the freetds driver ... but I saw that even on mysql i'm geting the same error. Reproduce code: --- $msdb = mssql_connect("192.168.0.5", "web","webpass"); mssql_select_db("DATABASE",$msdb); $result = mssql_query("SELECT DEALERS.PASS FROM DEALERS WHERE DEALERS.DEALER='" . $_POST["DealerName"] . "'", $msdb); $msrow = mssql_fetch_row($result); if ( $msrow[0] != $_POST["DealerPass"] ) { mssql_close($msdb); include("../include/error_message.html"); exit(); } Expected result: In $msrow[0] I should have the password ( I have the password when $_POST["DealerName"] matches one of the DEALERS.DEALER from DEALERS ) but if $_POST["DealerName"] can't be found in the table I'm getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource I "echo("Result = ".$result);" and when I have a match I'm getting "Result = Resource id #7" and when not a match I have "Result = 1". Is this correct ? Before using php 4.3.2 I didn't faced this problem ! Actual result: -- Warning: mssql_fetch_row(): supplied argument is not a valid Sybase result resource in /home/www/default/dealer/check_dealer.php on line 7 -- Edit bug report at http://bugs.php.net/?id=24721&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24721&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24721&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24721&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24721&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24721&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24721&r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=24721&r=support Expected behavior: http://bugs.php.net/fix.php?id=24721&r=notwrong Not enough info:http://bugs.php.net/fix.php?id=24721&r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=24721&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24721&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24721&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24721&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24721&r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=24721&r=gnused
#24720 [NEW]: mysql_result(): supplied argument is not a valid MySQL result resource
From: adrian at smartcall dot ro Operating system: linux slackware PHP version: 4.3.2 PHP Bug Type: *Database Functions Bug description: mysql_result(): supplied argument is not a valid MySQL result resource Description: I updated my php to php-4.3.2 on apache_1.3.27, I have mysql-3.23.57 and I also use freetds-0.61. My php ./configure line is './configure' '--prefix=/usr/local/misc/php' '--with-apxs=/usr/local/misc/apache/bin/apxs' '--with-mysql=/usr/local/misc/mysql' '--with-sybase-ct=/usr/local/misc/freetds' All my scripts ( that before worked ) are giveing me the followig error : Warning: mysql_result(): supplied argument is not a valid MySQL result resource mssql_fetch_row(): supplied argument is not a valid Sybase result resource This error apears when no line maches the query ! In the first place I thought that is the freetds driver ... but I saw that even on mysql i'm geting the same error. Reproduce code: --- $msdb = mssql_connect("192.168.0.5", "web","webpass"); mssql_select_db("DATABASE",$msdb); $result = mssql_query("SELECT DEALERS.PASS FROM DEALERS WHERE DEALERS.DEALER='" . $_POST["DealerName"] . "'", $msdb); $msrow = mssql_fetch_row($result); if ( $msrow[0] != $_POST["DealerPass"] ) { mssql_close($msdb); include("../include/error_message.html"); exit(); } Expected result: Warning: mssql_fetch_row(): supplied argument is not a valid Sybase result resource in /home/www/default/dealer/check_dealer.php on line 7 Actual result: -- In $msrow[0] I should have the password ( I have the password when $_POST["DealerName"] matches one of the DEALERS.DEALER from DEALERS ) but if $_POST["DealerName"] can't be found in the table I'm getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource I "echo("Result = ".$result);" and when I have a match I'm getting "Result = Resource id #7" and when not a match I have "Result = 1". Is this correct ? Before using php 4.3.2 I didn't faced this problem ! -- Edit bug report at http://bugs.php.net/?id=24720&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24720&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24720&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24720&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24720&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24720&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24720&r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=24720&r=support Expected behavior: http://bugs.php.net/fix.php?id=24720&r=notwrong Not enough info:http://bugs.php.net/fix.php?id=24720&r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=24720&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24720&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24720&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24720&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24720&r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=24720&r=gnused