tjverge Posted May 18, 2011 Share Posted May 18, 2011 Hi, I'm trying to get the records that are between two dates to show on my screen, right now nothing comes up my code I'm using is below $today = date('Y-m-d'); $lastweek = date('Y-m-d',strtotime('-7 days')); $sql = "SELECT * from `memos` WHERE `date` BETWEEN '$today' AND '$lastweek' AND `delete` !='1'"; $result = mysql_query($sql); echo "<ol>"; while ($row = mysql_fetch_array($result)) { echo "<li>".$row['memo']."</li>" ; } echo "</ol>"; Link to comment https://forums.phpfreaks.com/topic/236802-getting-mysql-data-between-two-dates/ Share on other sites More sharing options...
tjverge Posted May 18, 2011 Author Share Posted May 18, 2011 fixed it if anyone wants to know you need to reverse the $today and $lastweek in the $sql Link to comment https://forums.phpfreaks.com/topic/236802-getting-mysql-data-between-two-dates/#findComment-1217299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.