Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:24:43+00:00 2026-05-26T23:24:43+00:00

I am pulling some data from mysql database using PHP, now I would like

  • 0

I am pulling some data from mysql database using PHP, now I would like to place that data in a html table which I have completed, how can I make the table pageable if it goes over say 10 records? Is there a tutorial I can look into or any information where I can get this? Maybe a tool I can implement easily? I just haven’t found anything online about this topic but perhaps anyone here can lead me in the correct direction

I am currently using just a simple <table></table> html

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:24:43+00:00Added an answer on May 26, 2026 at 11:24 pm

    You can achieve paging with MySQL’s LIMIT keyword.
    You can then use a query string to tell the website which page to get.

    First we need to set a default page number and define how many results we want to display in the page:

    $items_per_page = 10;
    
    $page = 1;
    
    if(isset($_GET['page'])) {
        $page = (int)$_GET['page'];
    }
    

    The LIMIT keyword works by providing an offset and the number of rows you want to limit to. So now we need to figure out the offset:

    $offset = ($page - 1) * $items_per_page;
    

    Now we have all of the information we need to limit the results correctly based on the page number in our query string:

    $query = "SELECT column_1, column_2 FROM your_table LIMIT {$offset}, {$items_per_page};";
    $result = mysql_query($query) or die('Error, query failed');
    
    while($row = mysql_fetch_assoc($result)) {
       echo $row['column_1'] . '<br />';
    }
    

    Now to show your different pages you just add the query string to the end of your page URI.

    For example my_page.php?page=1 or my_page.php?page=2

    Perhaps you could try to figure out how to create the paging links by yourself and post more if you can’t get it to work.

    You just need to find out the total rows in your query with COUNT in MySQL and you can do all of the maths from there 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pulling some data from a table using LINQ 2 SQL...one of the pieces
I am pulling some data from a mysql table via the following: $result =
So, if I want to pull some data from my database (PHP, MySql), whether
I need some help pulling cell data from table when a user clicks the
I have some strings that I am pulling out of a database and I
I've been using mySQL for an app for some time, and the more data
I'm unsingf RestKit in my iPad Project pulling some JSON Data from Server. The
I'm runing a query to pull some movie data from a source table to
I am trying to do some simple statistics on data I am pulling from
We have an in-house application that pulls some data from some of Amazon's pages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.