So I'm getting this error message from MYSQL when I load this page. The first message is what's it displaying on the PHP code, the 2nd message is the result of mysql_error().
(1) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in [I][redacted][/I] on line 19
(2) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND CigarID = 334 AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= DateAdded' at line 1
When I run the query in mySQL it returns a result, as it should. So I'm not sure what's going on here. I've check to make sure the variable wasn't recycled and it's not. Any ideas what's going on here? Here's the offending code --
//Check User's Last Review
$SQL = "SELECT COUNT(CigarID) FROM reviews_cigar WHERE UserID = $UserID AND CigarID = $CigarID AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= DateAdded";
$Result = mysql_query($SQL);
$row = mysql_fetch_array($Result) or die(mysql_error());
if( $row[0] > 0 ){
$errormsg = "Sorry but you have submitted a review for this Cigar in the past 15 days";