aebstract Posted February 1, 2010 Share Posted February 1, 2010 $query = mysql_query("SELECT * FROM calendar WHERE date('n', date-start) = '$calmonth2'") or DIE(mysql_error()); 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 ' date-start) = '2'' at line 1 Can I use date like this in a query? Seems like I would get a different error if I couldn't. Quote Link to comment https://forums.phpfreaks.com/topic/190528-using-date-in-query/ Share on other sites More sharing options...
aebstract Posted February 1, 2010 Author Share Posted February 1, 2010 $query = mysql_query("SELECT * FROM calendar WHERE MONTH(date_start) = '$calmonth2'") or DIE(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/190528-using-date-in-query/#findComment-1004953 Share on other sites More sharing options...
fenway Posted February 1, 2010 Share Posted February 1, 2010 What's not working? Quote Link to comment https://forums.phpfreaks.com/topic/190528-using-date-in-query/#findComment-1004988 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.