php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24721 mysql_result(): supplied argument is not a valid MySQL result resource
Submitted: 2003-07-19 14:50 UTC Modified: 2003-07-19 16:06 UTC
From: adrian at smartcall dot ro Assigned:
Status: Not a bug Package: *Database Functions
PHP Version: 4.3.2 OS: linux slackware
Private report: No CVE-ID: None
 [2003-07-19 14:50 UTC] 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:
----------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-19 16:06 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

see #24720
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 11 18:01:24 2020 UTC