]Here's code I tried to use...
PHP Code:
<?
$path = "/home/wooolf/WWW/forum/admin"; // set the path to your admin directory. see above for info about this.
require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'") or die("oops1");
$cookietimeout = mysql_result($cookievalue, 0, 0);
$datecut = time()-$cookietimeout;
$total = mysql_query("SELECT SUM(views) AS threadviews FROM thread") or die("goddamnit");
while($total = mysql_fetch_array($total)):
$totalviews = number_format($total[threadviews]);
endwhile;
echo("$totalviews");
?>
Results: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wooolf/WWW/forum/totalviews.php on line 15
469,001
Line 15:
PHP Code:
while($total = mysql_fetch_array($total)):
PS::: this is just one of the 300 ways I have tried to do it...