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? Quote Link to comment 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] 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.