Quote:
Originally posted by Michael
But threadcount is incremented everytime something is posted, but if there was an error in MySQL and some information was deleted then threadcount would be inaccurate. If you wanted to delete a post through PhpMyAdmin then threadcount would be wrong.
Using a field that is incremented to keep count isn't very accurate.
|
Indeed, I'm not quite sure why no one is using this:
Code:
<?php
require( "forum/admin/config.php3" );
$db = mysql_connect( $servername, $dbusername, $dbpassword );
mysql_select_db( $dbname );
$query=mysql_query( "SELECT COUNT( * ) AS totalthreads FROM thread WHERE forumid = $forumid" );
$row = mysql_fetch_array( $query );
$totalthreads = $row[ totalthreads ];
echo "$totalthreads total threads";
?>
It's simple.
Easy.
And works.
[Edited by mrogish on 09-11-2000 at 01:22 AM]