$countviews=$DB_site->query_first("SELECT SUM(views) AS views FROM thread"); $totalviews=$countviews[views]; if ($totalviews=="") { $totalviews=0; }