Sounds like I can help here! I use a custom function to do this sort of thing. Simply add this to your code somewhere:
PHP Code:
function getRows($table, $where)
{
global $t;
$sql = "SELECT * FROM " . $table . " WHERE " . $where;
sqlTrace("getRows", $sql);
$result = mysql_query($sql);
$countOfRows = mysql_num_rows($result);
$ii = 0;
$row = array($countOfRows);
if ($countOfRows > 0)
{
while ($row = mysql_fetch_array($result))
{
$rows[$ii++] = $row;
}
}
return $rows;
}
And then when you want to use the function, use code similar to this....
PHP Code:
$countOfOnline = getNumRows("online_table", "online_row > 0");
echo $countOfOnline;