abs0lut Posted October 17, 2008 Share Posted October 17, 2008 mysql_query("SELECT date, userid FROM table WHERE userid=$userid AND date BETWEEN '$sdate' AND '$edate' ") or die(mysql_error()); could you please help me? Quote Link to comment https://forums.phpfreaks.com/topic/128793-solved-syntax-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 17, 2008 Share Posted October 17, 2008 Since table is a reserved keyword, that is probably the problem, but it would be really nice if you posted the error message to give us an idea what mysql thought the problem is. Quote Link to comment https://forums.phpfreaks.com/topic/128793-solved-syntax-error/#findComment-667735 Share on other sites More sharing options...
abs0lut Posted October 17, 2008 Author Share Posted October 17, 2008 I've change table into tbldate, still 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 'AND date BETWEEN '2008-10-10' AND '2008-10-20'' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/128793-solved-syntax-error/#findComment-667740 Share on other sites More sharing options...
PFMaBiSmAd Posted October 17, 2008 Share Posted October 17, 2008 If you echo out your query string, you will probably find that $userid is empty. Quote Link to comment https://forums.phpfreaks.com/topic/128793-solved-syntax-error/#findComment-667741 Share on other sites More sharing options...
abs0lut Posted October 17, 2008 Author Share Posted October 17, 2008 thank you Quote Link to comment https://forums.phpfreaks.com/topic/128793-solved-syntax-error/#findComment-667959 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.