Click to See Complete Forum and Search --> : I just get a error!


Pezmc
11-29-2006, 12:07 PM
Here is the code:
$sql = "SELECT received FROM $dbsql ORDER BY id LIMIT 1" ;
$results = mysql_query ( $sql );
while ( $myrow = mysql_fetch_array ($results )) {
$date = $myrow ["received" ];
echo $date ;
}

But all i get is this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/shogans.com/stats/stats.php on line 30

Table Structure:
Full Texts id browser ip recieved
29 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006/11/28
30 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006/11/29
31 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006/11/29
32 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006/11/29

legendx
11-29-2006, 12:13 PM
$results = mysql_query($sql) or die(mysql_error());


Edit that line to show the mysql error.. this will give you a more specific error about the problem. Make this regular practice in your queries.

Pezmc
11-29-2006, 12:24 PM
thanks

Pezmc
11-29-2006, 01:56 PM
I found the fault the word receieved was spelt Recieved in the table Received in the script.

Thanks for the error display help ill use that in the future