<? require("admin/config.php"); mysql_connect("$servername", "$dbusername", "$dbpassword") or die("Couldnt find MYSQL!"); mysql_select_db("$dbname") or die ("Couldnt find DB!"); $totalviews=mysql_query("SELECT SUM(views) AS threadviews FROM thread"); if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;} else {echo mysql_result($totalviews,0);} ?>