PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Feb 20, 2007 10:38 am
Code: Select all
<?PHP
$caRes = mysql_query("select * from catart") or die(mysql_error());
while($caRes = mysql_fetch_array($caRes))
{
print_r($caRes);
}
?>
i get this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Webspace\admins\addArticle.php on line 51
please help
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Feb 20, 2007 10:43 am
try
Code: Select all
$caRes = mysql_query("select * from catart") or die(mysql_error());
echo __FILE__,'@',__LINE__,': ', gettype($caRes);
while($caRes = mysql_fetch_array($caRes))
{
print_r($caRes);
}
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Feb 20, 2007 10:46 am
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
this is the result.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Feb 20, 2007 10:48 am
and the echo was ignored or did not print anything? Or has the code snippet you showed us maybe, just maybe nothing to do with the message you get?