php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5529 Supplied argument is not a valid MySQL result resource
Submitted: 2000-07-12 08:38 UTC Modified: 2000-07-12 08:59 UTC
From: jagas at computerconsultant dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Release Candidate 2 OS: Windows NT4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jagas at computerconsultant dot net
New email:
PHP Version: OS:

 

 [2000-07-12 08:38 UTC] jagas at computerconsultant dot net
        if ($dbh =  mysql_connect('localhost','root',''))
        {
                $strSQL = "select authorsname,bodytext from stories where id = $storyid";

					mysql_select_db('mydb');
					$stmt = mysql_query($strSQL, $dbh);
        
					$row = mysql_fetch_array($stmt);
    }

Compiled with MySQL

I get an error when I call "$row = mysql_fetch_array($stmt)" . The error is:
Supplied argument is not a valid MySQL result resource in .... on line 9.

This function worked perfectly in PHP 3.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-12 08:48 UTC] jagas at computerconsultant dot net
Sorry. My sql statement was wrong. The variable $storyid had no value hence ...
 [2000-07-12 08:59 UTC] stas at cvs dot php dot net
buggy bug report, close it
 [2003-01-16 13:45 UTC] joachim dot desmedt at meestersites dot be
I have the same problem.

$db = mysql_connect("xxx", "xxx", "xxx") or die ("Sorry.
mysql_select_db("name", $db);
$SQL_statement = "SELECT * FROM iks WHERE voornaam= $naam";
$resultset = mysql_query($SQL_statement);

while($data = mysql_fetch_array($resultset)){
echo $data['voornaam']

}

But I'm sure that $naam has a value.
Help me please!
 [2003-01-16 13:45 UTC] joachim dot desmedt at meestersites dot be
I have the same problem.

$db = mysql_connect("xxx", "xxx", "xxx") or die ("Sorry.
mysql_select_db("name", $db);
$SQL_statement = "SELECT * FROM iks WHERE voornaam= $naam";
$resultset = mysql_query($SQL_statement);

while($data = mysql_fetch_array($resultset)){
echo $data['voornaam']

}

But I'm sure that $naam has a value.
Help me please!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 01:01:32 2024 UTC