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 6153213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:03:28+00:00 2026-05-23T20:03:28+00:00

I have a table in mysql. Because it has many rows I want to

  • 0

I have a table in mysql.
Because it has many rows I want to put each 10 rows in a page and by clicking a link show me next 10 rows.
Is there any solution?

  • 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-23T20:03:29+00:00Added an answer on May 23, 2026 at 8:03 pm

    It was really really awesome http://www.phpsimplicity.com/tips.php?id=1

    it is so simple! no need to work with huge classes! I’m Happy:D

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>Paginate</title>
        </head>
        <body>
        <form method='get'>
            <?php
            $connection = Mysql_connect( 'server', 'user', 'pass' );
            if ( ! $connection ) {
                echo 'connection is invalid';
            } else {
                Mysql_select_db( 'DB', $connection );
    
            }
            //Check if the starting row variable was passed in the URL or not
            if ( ! isset( $_GET['startrow'] ) or ! is_numeric( $_GET['startrow'] ) ) {
    
                //We give the value of the starting row to 0 because nothing was found in URL
                $startrow = 0;
    
                //Otherwise we take the value from the URL
            } else {
                $startrow = (int) $_GET['startrow'];
            }
            //This part goes after the checking of the $_GET var
            $fetch = mysql_query( "SELECT * FROM sample LIMIT $startrow, 10" ) or
            die( mysql_error() );
            $num = Mysql_num_rows( $fetch );
            if ( $num > 0 ) {
                echo '
            <table border=2>';
                echo '
                <tr>
                    <td>ID</td>
                    <td>Drug</td>
                    <td>quantity</td>
                </tr>
                ';
                for ( $i = 0; $i < $num; $i ++ ) {
                    $row = mysql_fetch_row( $fetch );
                    echo '
                <tr>';
                    echo "
                    <td>$row[0]</td>
                    ";
                    echo "
                    <td>$row[1]</td>
                    ";
                    echo "
                    <td>$row[2]</td>
                    ";
                    echo '
                </tr>
                ';
                }//for
                echo '
            </table>
            ';
            }
    
            //Now this is the link..
            echo '<a href="' . $_SERVER['PHP_SELF'] . '?startrow=' . ( $startrow + 10 ) . '">Next</a>';
    
            $prev = $startrow - 10;
    
            //only print a "Previous" link if a "Next" was clicked
            if ( $prev >= 0 ) {
                echo '<a href="' . $_SERVER['PHP_SELF'] . '?startrow=' . $prev . '">Previous</a>';
            }
            ?>
        </form>
        </body>
    </html>
    

    By the way link of rickyduck was good too

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

Sidebar

Related Questions

I have a table in MySQL that has 3 fields and I want to
I have a MySQL table from a third-party application that has millions of rows
I have mysql table that has a column that stores xml as a string.
I have a table in MySQL 4.0 which currently has a year field as
Lets say I have a table in MySQL called articles, that has a column
I have a table in MySql DB which I want to load it to
I have a MySQL table which has three columns: Authority | MapID | Time
I have two MySQL tables A and B . Table A has a member
I have a MySQL table which has about 30 columns. One column has empty
I have a MySQL table with a primary key field that has AUTO_INCREMENT on.

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.