vietboy505 Posted April 10, 2006 Share Posted April 10, 2006 [code]<?php//today date is: 2006-04-10 08:18:24//last week is: 2006-04-03 06:23:10$lastWeek=date('Y-m-d H:i:s', strtotime('-1 week'));//How do I get any date before last week(2006-04-03 06:23:10)//This show all date start from last week (2006-04-03 06:23:10) up to today (2006-04-10 08:18:24)$result = mysql_query("SELECT * FROM $table WHERE dateCreate >= '$lastWeek' //I want the opposite of this, from before last week, not from last week up to today.?>[/code] How can fixed the above code to get all dates in the database from before last week? Any idea? Link to comment https://forums.phpfreaks.com/topic/7042-get-dates-before-from-last-week/ Share on other sites More sharing options...
Barand Posted April 10, 2006 Share Posted April 10, 2006 [code]$result = mysql_query("SELECT * FROM $table WHERE dateCreate < '$lastWeek' ");[/code] Link to comment https://forums.phpfreaks.com/topic/7042-get-dates-before-from-last-week/#findComment-25597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.