CodeCanyon

PHP Pagination Class

  • Has been a member for 0-1 years
  • Bought between 10 and 49 items
  • United Kingdom
wdlb says
Purchased

Dear Imad Jomaa,

Thank you very much for your quick response. I found the solution in the file you sent me. i had

$pagination = new Pagination($limit, $rows, $page, $location);

instead of

$pagination = new Pagination(5, $rows, $page, “http://www.website.com/something.php?page”);

Once again, Thank you.

The script is brilliant and looks very good.

All the best,

wdlb

5 months ago
Author
ImadJomaa ImadJomaa replied

Hello Wdlb,

Thank you for the kind comments. Glad to hear everything is working as expected. =)

All the best, Imad Jomaa.

5 months ago
  • Has been a member for 0-1 years
  • Bought between 10 and 49 items
mex4F says
Purchased

hey ImadJomaa could you help me please? can’t go to the next page there is Warning: mysql_num_rows() expects parameter 1 to be resource, null given in here is my code <?php

define(“IN_PAGI”, true); require(“class_pagination.php”); //grab the current page $page = intval($_GET[‘page’]); //set the page if empty if(empty($page)) { $page = 1; }

$rows = mysql_num_rows($result); $Location=”http://localhost/ez-users-with-facebook-integration/Herren.php?page”; $pagination = new Pagination(5, $rows, $page, $Location); $start = $pagination->prePagination(); $result = mysql_query(“SELECT * From artikel Where cat>6 LIMIT $start, 5”); echo “”; echo ”<center>$rows[Artikelbezeichnung]</center>”; echo “
”; echo ”<center> $rows[Datum] </center>”; echo “
”; echo “
”; echo “ ”; }

while ($rows=mysql_fetch_array($result)) {

$pagination->pagination(); ?>

3 months ago
Author
ImadJomaa ImadJomaa replied

Hello mex4F’s, The problem lies within ”$rows = mysql_num_rows($result)”. $result variable isn’t defined, in addition, it must be a resource. In this case, $result should equal: mysql_query(“SELECT * From artikel Where cat>6”);

And so you know, you can’t use $rows to retreive the data, you must do something like: $row = mysql_fetch_assoc($query)....

If you’d like, you can email me and I can send you an example file if what I’m saying isn’t quite clear.

If you have any other questions let me know,

All the best, Imad Jomaa.

3 months ago
  • Has been a member for 0-1 years
  • Bought between 10 and 49 items
mex4F says
Purchased

thanks for your fast reply there is no error code but he didn’t move to the next page

$pagination = new Pagination(5, mysql_query(“SELECT * From artikel Where cat>6”), $page, “http://localhost/ez-users-with-facebook-integration/Herren.php?page”); $start = $pagination->prePagination(); $query = mysql_query(“SELECT * From artikel Where cat>6 LIMIT $start, 3”); echo “”; echo ”<center>$row[Artikelbezeichnung]</center>”; echo ”<right>$row[Stylepoints]</right>”; echo “
”; echo ”<center> $row[Datum] </center>”; echo “
”; echo “
”; echo “ ”; }

while  ($row = mysql_fetch_assoc($query)) {

$pagination->pagination(); ?>

3 months ago
Author
ImadJomaa ImadJomaa replied

Hello,

The second parameter of the Pagination method must be an integer, you are offering it a resource. Refer to the documentation for a detailed explanation of the parameters. If you like, I can email you an example file that illustrates how the pagination class was implemented.

All the best, Imad Jomaa.

3 months ago
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
amax2222 says

could I use this script with wordpress for a home page? I know there are functions and plugins for wordpress however for this project in a Wordpress MU environment I have needed to do some direct sql queries and not able to use the default pagination. Will your class create the extra pages on a home page in Wordpress? Thank you

1 month ago
Author
ImadJomaa ImadJomaa replied

Hello,

The pagination class is designed to be plugged into anything really. So as long as you implement it correctly to paginate the posts on the homepage , there should be no problem. If you’d like, shoot me an email and I can send you an example implementation file (not for wordpress, it’s generic) before you purchase to see if the way it is implemented can suit your needs.

All the best, Imad Jomaa.

1 month ago
  • Has been a member for 5-6 years
  • Bought between 10 and 49 items
  • Portugal
malomedia says
Purchased

This is all very confusing. I can not get anything to work. I have been trying for the comments but nothing helps. Too bad …

1 month ago
Author
ImadJomaa ImadJomaa replied

Sorry to here you that you are having troubles getting it to work. Please shoot me an email with more details and I’ll gladly help. =)

28 days ago
by
by
by
by
by