Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search page - "next" problem

Status
Not open for further replies.

kathanon

Technical User
Jan 29, 2002
218
0
0
GB
I have a search page that gets images from a database and contains 140 images. The problem comes when a particular term is searched for and a result- say of 10 images- returned. The first page displays fine, but when the link for the next page is used, it defaults back to all 140 images, instead of showing the next set of results. I am very new to this and am trying to resolve this - I hope I have put all of the relevant code. I wonder if anyone can point me in the right direction.

<td nowrap>Images <b><?php echo ($startRow_imgs) ?></b> to <b><?php echo ($startRow_imgs + $totalRows_imgs) ?></b>
returned out of <strong><?php echo $allRows_imgs ?></strong> total.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"> <table border="0">
<tr>
<td align="center"> <?php if ($pageNum_imgs > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_imgs=%d%s", $currentPage, 0, $queryString_imgs); ?>">First</a>
|
<?php } // Show if not first page ?> </td>
<td align="center"> <?php if ($pageNum_imgs > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_imgs=%d%s", $currentPage, max(0, $pageNum_imgs - 1), $queryString_imgs); ?>">Previous</a>
|
<?php } // Show if not first page ?> </td>
<td align="center"> <?php if ($pageNum_imgs < $totalPages_imgs) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_imgs=%d%s", $currentPage, min($totalPages_imgs, $pageNum_imgs + 1), $queryString_imgs); ?>">Next</a>
|
<?php } // Show if not last page ?> </td>
<td align="center"> <?php if ($pageNum_imgs < $totalPages_imgs) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_imgs=%d%s", $currentPage, $totalPages_imgs, $queryString_imgs); ?>">Last</a>
<?php } // Show if not last page ?> </td>
</tr>
</table>
 
Thank you sleipnir,

The FAQ is clear and concise, I will try to find out how to implement it in the code for my page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top