View Single Post
Old 2006-12-01, 01:20 PM   #3
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
I use this basic code to do something similar to what you are looking for.

PHP Code:
<?php
$OneWeekAgo 
date('Y-m-d'mktime(000date("m"), date("d")-7date("Y")));
$query DatabaseQuery("SELECT * FROM table");
while(
$rows mysql_fetch_array($query)){
    if (
$rows[lastaction] < $OneWeekAgo)
        echo 
$rows[name].' last action was more than one week ago ('.$rows[lastaction].')<br>'."\n";
    else
        echo 
$rows[name].' was active <b>within the last week</b> ('.$rows[lastaction].')<br>'."\n";
}
?>
Change the table and field names to suit your needs.

** DatabaseQuery(); is a self made database access function, so you will have to alter the query to suit your needs, but the rest is straightforward.
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.
oast is offline   Reply With Quote