And now mysql4 allows doing this another way, I *assume*
this new way is slightly faster then the additional
count() although I haven't tested it and wonder if it
affects mysql_num_rows()...
See: SQL_CALC_FOUND_ROWS()
http://www.mysql.com/doc/en/Miscellaneous_functions.html
Regards,
Philip
I would also tend to do a count(*) as well as the main query if I intend to
use pagination (with the help of LIMIT in the main query).
Suppose, for example, you're limiting to 30 news posts per page, and from
calculations there are only 2 pages that fall into the criteria, then trying
to bring the
First, there is no reason to do mycounter like this
when mysql_num_rows() will work perfectly. It's not
based on any certain column numbers or primary keys.
Although if you're suggesting this method to simply
print 0-n in the loop (as users may want to know the
row number of output not any id nu
3 matches
Mail list logo