Jump to content

DB_Pager Problem, paginating multiple records from database


Beedy555

Recommended Posts

Hello, i am having an issue when i try to go through multiple pages from a database. The database contains apartment information. I currently have it set to limit my results to 30 per page and this is working correctly, however when i try to scroll to page two like 1..2..3 i am displayed with every apartment listed in the database, and not the certain category that i would like selected.

 

//assigning variables

$SESuser_lng = $_COOKIE['SESuser_lng'];

$SESuser_admlevel = $_COOKIE['SESuser_admlevel'];

$id = $_GET['id'];

$pgrow = $_GET['pgrow'];

$msg = $_GET['msg'];

$ht_filter = $_GET['ht_filter'];

 

//sql query to retrieve result set $htfilter selects the distinct apartment categories

 

$sqlFilter = ($ht_filter > 0 ? " WHERE p.idhotel = $ht_filter" : "");

$sql = "SELECT p.id, p.idhotel, p.nombre, p.thmb, p.archivo, h.nombre

FROM prensa p

LEFT JOIN hoteles h ON p.idhotel = h.id

$sqlFilter

ORDER BY p.nombre, h.nombre";

 

//DB_pager

$nav = new DB_Pager('30');

$result = $nav->execute($sql, $dbcnx);

 

//Javascript link creation

<span id="display-links"><?php echo $nav->display_links(); ?></span>

 

any help will be greatly appreciated  :)

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.