Here is my php code:
$sql2 = 'SELECT `username`, `user_lastvisit` FROM `phpbb_users` where `user_rank` = 1 or `user_rank` = 2 or `user_rank` = 6 or `user_rank` = 5 AND `user_lastvisit` < (unix_timestamp(now()) - 604800) ORDER BY `user_lastvisit` DESC';
$result2 = mysql_query($sql2,$dbh2);
print "<br><br>In-Active Council Member.<br><br>";
while($result2_row = mysql_fetch_array($result2)){
// Simple output to screen
{
if ($result2_row['username'] != 'user10')
{
$unixtime = $result2_row['user_lastvisit'];
echo $result2_row['username'], " - ", date('d M Y',$unixtime), " - ", time()-604800, " - ", $result2_row['user_lastvisit'];
echo "<br>";
}
}
};
and here is the output:
User1 - 26 Apr 2005 - 1113956786 - 1114556358
User2 - 25 Apr 2005 - 1113956786 - 1114441924
User3 - 24 Apr 2005 - 1113956786 - 1114391420
User4 - 22 Apr 2005 - 1113956786 - 1114205256
User5 - 25 Feb 2005 - 1113956786 - 1109358813
User6 - 09 Feb 2005 - 1113956786 - 1107967939
User7 - 27 Jan 2005 - 1113956786 - 1106882425
The first four users shouldn't be showing?!?!
If I reverse the sql, it displays all the users correctly.
Please help this PHP nube.