Forum Moderators: coopster
What am I failing to grasp here?
while ($row=mysql_fetch_array($result)) {
// NOW $row is an array - but it's an array of the FIELDS you selected
$len = count($rows);
echo "<p>";
for ($i=0;$i<$len;$i++) { // Remembering arrays start at index 0 (zero)
echo " i: $i " . $row[$i] . " ";
}
echo "<p>\n";
}
$whosonline = "SELECT log_activecheck FROM members_log WHERE log_isonline = 'y'";
$result = mysql_query($whosonline);
$twmincheck = strtotime ( " -20 minutes " ); // the 20 mins ago maths in english, nice
if ($row = mysql_fetch_array($result)) {
do {
$activecheck1 = $row['log_activecheck']; // sql timestamp
$activecheck = strtotime($activecheck1); // php safe now
if ($twmincheck > $activecheck) {
$nowoffline = "UPDATE members_log";
$nowoffline.= " SET log_isonline = 'n'"; // outside 20 mins they're now offline
mysql_query($nowoffline);
} // end if
} // end do
while ($row = mysql_fetch_array($result));
}; //end if
$nowoffline = "UPDATE members_log SET log_isonline = 'n' WHERE log_activecheck < '" . $twminsago . "' AND log_isonline = 'y'";