dbradbury Posted January 3, 2011 Share Posted January 3, 2011 if so how would they be used in a mysql query? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 3, 2011 Share Posted January 3, 2011 PHP and SQL syntax really have nothing to do with each other, however they are used in a SQL query the same as they are in php. What's the problem? Quote Link to comment Share on other sites More sharing options...
dbradbury Posted January 3, 2011 Author Share Posted January 3, 2011 i need to select all posts in a forum that were posted previous to 'todays date' <- obviously changing daily.... note that the subject of the posts will be date format of YYYY/MM/DD (Y/m/d) i have something like $getbookings = mysql_query("SELECT * FROM phpbb_posts WHERE forum_id=17 AND post_subject <= '$date' ORDER BY post_subject ASC"); but think i need to add a date variable declaring todays date..? Quote Link to comment Share on other sites More sharing options...
dbradbury Posted January 3, 2011 Author Share Posted January 3, 2011 done i used CURDATE() so it was: $getbookings = mysql_query("SELECT * FROM phpbb_posts WHERE forum_id=17 AND post_subject <= '$date' ORDER BY post_subject ASC"); Quote Link to comment 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.