Jump to content

[SOLVED] supplied argument is not a valid MySQL result resource


Voodoo Jai

Recommended Posts

I am getting the following error msg:

 

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/poochima/daytripper.com/counter.php3 on line 8

 

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/poochima/daytripper.com/counter.php3 on line 22

 

 

and this is the code it refers to

 


$result=mysql("Counters","SELECT * FROM count WHERE Base='$Base' AND URL='$URL'");

LINE 8 next
while ($row = mysql_fetch_row($result)) {
$ChkBase=$row[0];
$ChkURL=$row[1];
$ChkCount=$row[2];
$Count=$ChkCount;
}
if ($ChkURL == "") :
mysql("Counters","INSERT INTO count VALUES ('$Base','$URL','0')");
$Count=0;
endif;
$Count++;
mysql("Counters","UPDATE count
SET Number='$Count' WHERE Base='$Base' AND URL='$URL'");
$result=mysql("Counters","SELECT * FROM count WHERE Base='$Base' AND URL='$URL'");

LINE 22 next
while ($row = mysql_fetch_row($result)) {
$Base=$row[0];
$URL=$row[1];
$Count=$row[2];
}

 

I cannot see what the problem is.

 

VoodooJai

Unless you have written a function called mysql() that contains a mysql_query() function call, that code is not executing a mysql_query() statement.

 

And if you have written a function called mysql(), you would need to post it to get help with why it is not working.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.