blue-genie Posted May 13, 2010 Share Posted May 13, 2010 no resultsYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 $result = mysql_query("select count(*) as count FROM gamedetails WHERE gameID <> $editGameID AND startDate<=Date($newStartDate) AND endDate>=DATE($newStartDate) OR startDate<=DATE($newEndDate) AND endDate>=DATE($newEndDate)"); Quote Link to comment https://forums.phpfreaks.com/topic/201622-syntax-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 13, 2010 Share Posted May 13, 2010 That error is indicative of a numeric value that is empty. I recommend forming your query in a variable ($query) so that you can echo the actual query so that you can see what is wrong with it. It's likely that $editGameID is empty (you should be validating all data being put into any query.) You will also have problems with the DATE() functions in the query because mysql expects strings as the parameter in the DATE() function call. You must have single-quotes around the parameter if you are supplying literal values in the query. Quote Link to comment https://forums.phpfreaks.com/topic/201622-syntax-error/#findComment-1057688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.