Jump to content

Archived

This topic is now archived and is closed to further replies.

vietboy505

get dates before from last week

Recommended Posts

[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?

Share this post


Link to post
Share on other sites
[code]$result = mysql_query("SELECT * FROM $table WHERE dateCreate < '$lastWeek' ");[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.