I'm not certain but my guess would be that when you are trying to retrieve the last date from the date column in the database, mySQL is reading that as the date() function and returning an error because the function is not formatted correctly.
PHP Code:
$last_controlled = mysql_query("SELECT LAST(date) AS last_controlled FROM controller_log WHERE cid='$cid' AND duration >=3600", $con3) or die("Failed to query: " . mysql_error());;
You might try changing the column name in the database to something like "col_date" or something to avoid keyword issues. Don't forget to update the php code too if you do.
You might also look at the number of semicolons at the end of each line. It looks like there might be a few lines with extras.
Hope this helps.
|