Hi I have a database search results page that I would like to paginate but as it moves from the first page to the next page it loses the value of the search term. s <?php $search_rs = new WA_MySQLi_RS("search_rs",$connection,10); $search_rs->setQuery("SE
Hi
I have a database search results page that I would like to paginate but as it moves from the first page to the next page it loses the value of the search term.
ie
The recordset is
<?php
$search_rs = new WA_MySQLi_RS("search_rs",$connection,10);
$search_rs->setQuery("SELECT * FROM items WHERE items.itemTitle LIKE '%".$_POST['search']."%' ORDER BY items.itemTitle ASC");
$search_rs->execute();
?>
with 'search' being POSTed from another page.
This successfully produces a list of 10 results using ...
<?php
while(!$search_rs->atEnd()) {
?>
<tr>
<td><?php echo($search_rs->getColumnVal("itemNo")); ?></td>
<td><?php echo($search_rs->getColumnVal("itemTitle")); ?></div></td>
</tr>
<?php
$search_rs->moveNext();
}
$search_rs->moveFirst();
?>
Adding and clicking the link
<a href="<?php echo $search_rs->getNextPageLink(); ?>">Next</a>
before the results listing gives "undefined index" for the query ie it has lost the 'search' value.
Hope that this makes sense.
Would be grateful for any suggestions to solve this.
Thanks
Andrew