----- Original Message -----
From: "mos" <[EMAIL PROTECTED]>
> > > I have a Where clause like:
> > >          select count(*) from table where ....  LIMIT 100
> > > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why?
>>
> >If You want to know the number of rows in the recordset returned by the
query
> >then You should use "mysql_num_rows()".
>
> This seems like the most economical way to approach it.


Actually, I think you've got it completely backwards. :)  Using
mysql_num_rows() on a result set will force you to do a query that returns
all of the rows, while using count(*) will (much more efficiently) use the
index to return the number of rows.

Cheers,

Ryan Fox, Geek     email: [EMAIL PROTECTED]
BackWatcher, Inc.     web: http://backwatcher.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to