#5529 [Com]: Supplied argument is not a valid MySQL result resource
| From: | joachim dot desmedt at meestersites dot be | Date: | Thu, 16 Jan 2003 19:45:50 +0000 |
| Subject: | #5529 [Com]: Supplied argument is not a valid MySQL result resource | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30288@lists.php.net to get a copy of this message | ||
ID: 5529
Comment by: joachim.desmedt@meestersites.be
Reported By: jagas@computerconsultant.net
Status: Closed
Bug Type: MySQL related
Operating System: Windows NT4
PHP Version: 4.0 Release Candidate 2
New Comment:
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!
Previous Comments:
------------------------------------------------------------------------
[2000-07-12 08:59:57] stas@cvs.php.net
buggy bug report, close it
------------------------------------------------------------------------
[2000-07-12 08:48:21] jagas@computerconsultant.net
Sorry. My sql statement was wrong. The variable $storyid had no value
hence ...
------------------------------------------------------------------------
[2000-07-12 08:38:36] jagas@computerconsultant.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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=5529&edit=1