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
Share on other sites

  • 4 weeks later...
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.