October 30th, 1999, 12:16 AM
I have my script limiting the number of records returned from a search to 10...
then I provide a link to another php page adding 10 to the offset to return the next 10 records...
however, the next 10 records that are being returned are not of the same query that the person searched for... the 10 records that are returned are starting from the 10th record in the entire dataset...
any ideas on how to bring up the next 10 records from what was already searched for?
October 30th, 1999, 11:36 AM
What DBMS are you using?
Could we see your SQL statement?
If you're using MySQL (which most people on this BBS seem to), you should probably be using the MySQL LIMIT function; but it also depends on the rest of the SELECT statement being set up correctly.
SELECT * FROM Monsters WHERE Nocturnal='yes' ORDER BY Weight LIMIT 0, 10;
SELECT * FROM Monsters WHERE Nocturnal='yes' ORDER BY Weight LIMIT 10, 10;
Whatever database you're using, you should use the SQL to limit the results, not PHP code.