[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1430
  • Last Modified:

How to display results on multiple pages using pagination

I would like to query my database table and display results on multiple pages. For example if I have 100 rows in my result, I want to be able to set each page to show 20 rows or x-number of rows per page. I know how to loop the row results, but I dont know how to setup a pagination to click back forth between pages. How can this be programmed easily? I would also want it to say "showing results 1 - 10 of 100" etc.. with arrows to click back and forth between pages like this < 1 | 2 | 3 | 4  >
<table width="100%" bgcolor="#CCCCCC" cellspacing="1">																				
<td>Trade Name</div></td>							
$sql = "SELECT * from vendors";
$query = mysql_query($sql);
while ( $row = mysql_fetch_assoc($query) ) {
<td><? echo $row["vendor_id"]; ?></td>						
<td><? echo $row["trade_name"]; ?></td>
<? } ?>

Open in new window

1 Solution
u better use a tutorial than ready made solution, if you know exactly what you are doing, you can debug it easily, besides, it is an easy thing to do
have a look here
it is a "detailed" description
pdheadyAuthor Commented:
Just want I was looking for! Thanks.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now