Unespected SQL error
Posted: Thu Jul 24, 2003 8:11 am
Here is the code and the error i get...
Two things to keep in mind:
1 the code seemed to work for a while
2 it broke
The error i get:
" line...
thanks
Two things to keep in mind:
1 the code seemed to work for a while
2 it broke
Code: Select all
if (!empty($_SERVER['HTTP_REFERER']))
{
$SQL = "SELECT referrer,count FROM vc_referrer WHERE referrer='{$_SERVER['HTTP_REFERER']}'";
if (mysql_query($SQL)) {
$Data = mysql_fetch_array($SQL);
$count = $Data['count'] + 1;
mysql_query("UPDATE vc_referrer SET count='$count' WHERE referrer='{$_SERVER['HTTP_REFERER']}'");
}
else {
mysql_query("INSERT INTO vc_referrer ( referrer ) VALUES ( '{$_SERVER['HTTP_REFERER']}' )");
}
}Line 31 is the "$Data = mysql_fetch_array($SQL);Evil SQL error wrote: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/index.vc on line 31
" line...
thanks