Jump to content

php pagination


quasiman

Recommended Posts

I'm attempting to use a pagination script I've found, but I'm not getting it to output into my records correctly.

 

Here's the link to the pagination script (they don't have a forum for help over there)

http://www.goodphptutorials.com/out/Simple_PHP_MySQL_Pagination

 

 

Here's the pagination class and sql query that I'm trying to use, and I think the only real problem with it is the sql:

 

<?php // create the pagination class
$pagination = new Pagination();
$pagination->setLink("search_log_results.php?page=%s");
$pagination->setPage($page);
$pagination->setSize($size);
$pagination->setTotalRecords($total_records);

//Find the search string and type from the database:
$getlogs = mysql_query("SELECT * FROM logs WHERE username LIKE '%$string%'" . $pagination->getLimitSql() . "ORDER BY logid DESC", $sqlconnection);?>

 

And the paging links:

<?php
$navigation = $pagination->create_links();
echo $navigation; // will draw our page navigation
?>

 

No errors, but it doesn't display any records either...any help would be appreciated!

 

Link to comment
https://forums.phpfreaks.com/topic/91319-php-pagination/
Share on other sites

  • 4 weeks later...

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.