Run a LIMIT clause through your SELECT statement, and pass a $_GET variable to the function. ie -
function selectRows($offset=0){ //$offset is the beginning row number
//set up an incrementor for the resulting return associative array
$i=0;
//limit your query - $offset is initially set to 0, so the first run will go from row 0 to 10
$query = "SELECT * FROM tblMyTable LIMIT $offset, 10;";
$recordset=mysql_query($qry);
while($line = mysql_fetch_assoc($rs)){
foreach($line as $key=>$var){
$returnArray[[$i][$key] = $var;
}
$i++;
}
$returnArray['offset'] = $offset + 10; //here, add the number of records returned by this recordset so you start with a new record next time
return($returnArray);
}
Then, in your calling page, add the $returnArray['offset'] to the anchor reference, as so -
<a href="thisPage.php?offset=<?php print $returnArray['offset']); ?>">next</a>
And make sure you call the loading function with the proper argument, as so
$returnArray = selectRows($_GET['offset']);
This should give you your offset and allow you to increment the resulting recordset - simply reverse it for the Previous link. And if you need to figure out hoe many pages the total search amounts to, use COUNT, then round to the total number of pages.