Re: Select a subset?
| From: | Clive Bruton | Date: | Mon, 15 Jul 2002 15:01:17 +0000 |
| Subject: | Re: Select a subset? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20555@lists.php.net to get a copy of this message | ||
Adam Alkins wrote at 15/07/02 04:06
>mysql_num_rows just counts the amount of rows in a query, so if you only
>selected 10 rows, it will return 10.
>
>If you want to count all the rows in the table, its best to use the COUNT()
>function
>
> SELECT COUNT(*) FROM table
In my example, I've selected all rows, ie no search criteria. But let's
assume that I have in fact searched for something that returns half the
records in the table (5,000 rows).
How do I get both the number of rows found (5,000) and get a subset of
the records (ie 0-9, 10-19, 20-29...) so that a user can browse through
the records rather than getting 5,000 at a time (but still know that a
total of 5,000 were found).
I hope this makes sense.
-- Clive