dbradbury Posted January 3, 2011 Share Posted January 3, 2011 if so how would they be used in a mysql query? Link to comment https://forums.phpfreaks.com/topic/223294-these-exist-in-php/ 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? Link to comment https://forums.phpfreaks.com/topic/223294-these-exist-in-php/#findComment-1154336 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..? Link to comment https://forums.phpfreaks.com/topic/223294-these-exist-in-php/#findComment-1154352 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"); Link to comment https://forums.phpfreaks.com/topic/223294-these-exist-in-php/#findComment-1154364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.