query($query); $stats = array(); if(mysql_num_rows($result)) { while($stat = mysql_fetch_array($result)) { $stats []= $stat; } } return $stats; } function performSuck($type) { global $db; $query = "INSERT into ".DB_PREFIX."statistics (error, type) values (1, '".$type."')"; $result = $db->query($query); if ($result) { return mysql_insert_id(); } return 0; } function completeSuck($id, $count) { global $db; $query = "UPDATE ".DB_PREFIX."statistics set completed=NOW(), count=".$count.", error=0 WHERE id=".$id; $result = $db->query($query); if ($result) { return 1; } return 0; } } ?>