Jump to content

displaying results from a certain date till now


digitalgod

Recommended Posts

[code]$timestamp = 'some_unix_timestamp_here'; // replace it with a timestamp
$query = mysql_query("SELECT * FROM some_table WHERE timestamp<=".time()." AND timestamp>={$timestamp}");
if(mysql_num_rows($query) <= 0)
{
echo "No things from ".date('r')." untill now";
}
else {
while($row = mysql_fetch_assoc($query));
{
// do stuff
}
}[/code]

In case you have it in a database where the date is stored as a UNIX timestamp, which would be the prefered way to do it.

Archived

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

×
×
  • Create New...

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.