Jump to content

[SOLVED] Sort for last 7 days


Vivid Lust

Recommended Posts

Get the timestamp from seven days ago

 

$sevenDaysAgo = strtotime('-7 days');

 

and select all rows with a timestamp greater than or equal to what you just computed.

 

$query = 'SELECT DISTINCT `URL` FROM hits WHERE `cat`="language" AND `Time` >= ' . $sevenDaysAgo;
$result = someSortOfFunctionThatExecutesQueries($query);

 

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.