Output dynamic DB records into several pages

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
MrVon
Forum Newbie
Posts: 1
Joined: Wed Feb 16, 2011 6:11 pm

Output dynamic DB records into several pages

Post by MrVon »

I have created script that puts user information in MySQL database table called "Users" when they register.
Now i want to create page to show all the accounts in that table and some custom fields they filled in as well.

Like Name, Age, Sex.
My table is

1Name 2Age 3Sex 4Email
John 22 M john@gmail.com
Kate 34 F kate@yahoo.com
etc...

I trying to show all users at once, so far i pulled info one by one successefully, and also queried that entire table trough array, but its creates huge list on one page i dont like this, i need to separate it to 10 accounts per page. How can i do that?

I also like page 1, page2, page3 be linkable from homepage is there way to make them have static page like http://site.com/users.php?pages=2.

Please advise.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Output dynamic DB records into several pages

Post by alex.barylski »

What you are looking for is called a pager or pagination. Google it or search these forums, the topic has come up many times over and some pre-built existing solutions exist that might meet your requirements.

Cheers,
Alex
Post Reply