Use a select string as in,

    $sel="select * from product where price<100 order by price LIMIT 0,100";

This would result in the query only returning the first 100 records. If you
want to page through them (back and next links). You would have to save the
current start point and the length would be the number of records you want
to display. Take the following example (please) which selected records in
groups of tens:

sel="select count(*) from product";
$res=mysql_query($sel) or die(mysql_error());
if ($start>$totalmsg) {
$res=mysql_query($sel) or die(mysql_error);
if ($numselected<$numtoprocess) {
$sel="select * from product limit $start,$numtoprocess";
for ($i=0;$i<$numtoprocess;$i++) {
    process the record here

yada, yada, yada (put your back and next buttons here)

The above code is stripped of most error checking etc., but it should give
you a framework to get started.

Michael Lewis

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to