function dbcount($field, $table, $conditions = "") { $cond = ($conditions ? " WHERE ".$conditions : ""); $result = @mysql_query("SELECT Count".$field." FROM ".$table.$cond); if (!$result) { echo mysql_error(); return false; } else { $rows = mysql_result($result, 0); return $rows; } }