LIMIT and get_num_rows

From: Date: Mon, 14 Jan 2002 10:55:56 +0000
Subject: LIMIT and get_num_rows
Groups: php.db 
Request: Send a blank email to php-db+get-15752@lists.php.net to get a copy of this message
hi guys, just looking for verification on this, as i don't think there's any way to do it.... Basically, i want to return the results for a search, but only return the first 20 results from the start number given.... LIMIT $start, 20 BUT... i'd like to have a page 1-whatever so if there are 65 results in total, then the first 20 will be shown, but there will be options to move to pages 2,3 or 4. Obviously, if i use LIMIT, then it won't know that there are 65 in total, so how would i get around this? do i just have to do the full query, and then only use the first 20 results in the results set? just becomes a bit of a problem if there are, say, 8000 results returned! would it just be best to return the first 200 using LIMIT, and do my pages for those, with a note that there are more than 200 results, and to refine the search criteria? Cheers, Matt --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02

« previous php.db (#15752) next »