Quote:
Originally posted by Chris Schreiber
Code:
$query = "select * from thread";
This must be very resource intensive though.... you are reading all of your threads simply to find out how many there are. I think you would be better off with something like this:
Code:
SELECT COUNT(*) FROM thread
HTH.
-Chris
[Edited by Chris Schreiber on 09-08-2000 at 04:58 PM]
|
Not 100% sure, but shouldt that be something more like:
Code:
$query=mysql_query("SELECT COUNT(threadid) AS totalthreads FROM thread");
Then you could just grab the total threads by doing something like:
Code:
$row=mysql_fetch_array($query);
$totalthreads = $row[totalthreads];
echo "$totalthreads total threads";
???
I didnt think of this the first time, because im not very knowledgable on server load / mysql strain.....etc... So i guess i really didnt care
~Chris