Hello there,
I've been working with PHP/mySQL for a while, and as of today I get an error on the following query:
$query = "SELECT * FROM stats WHERE URL='$URL'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
//statements here
}
The error I get is "Warning: Supplied argument is not a valid MySQL result resource in d:\web\websites\phpincludes\visitor_stats.inc.php on line x"
Now I know this is because the resultset doesn't contain any rows, but normally it did't give this error on the fetch command, that is, until now.
Any ideas?
Thanks in advance,
Stijn Teijssen
I've been working with PHP/mySQL for a while, and as of today I get an error on the following query:
$query = "SELECT * FROM stats WHERE URL='$URL'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
//statements here
}
The error I get is "Warning: Supplied argument is not a valid MySQL result resource in d:\web\websites\phpincludes\visitor_stats.inc.php on line x"
Now I know this is because the resultset doesn't contain any rows, but normally it did't give this error on the fetch command, that is, until now.
Any ideas?
Thanks in advance,
Stijn Teijssen