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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.