[snip]
I think that the fastest method and the cheapest one is using "select 
count(*) from table" and using mysql_num_rows(), isn't it ? but there
realy 
is no other way of retrieving the count() directly, without passing by
the 
php function ?
[/snip]

Actually, SELECT COUNT only returns one row, the count of the table. Do
this

Select count(*) AS foo from table

$bar = mysql_fetch_array($result);
Echo $bar['foo'];

Faster and more efficient since MySQL maintains this information in an
indexed sort of way. If you do

Select * from table

$result = mysql_query

Echo mysql_num_rows($result);

That counts the rows actually returned in the result set.






-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to