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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:45:30+00:00 2026-05-18T04:45:30+00:00

If i had a mysql db with 7000 records in it and i had

  • 0

If i had a mysql db with 7000 records in it and i had to display all 7000 on my webpage. Are there any tips and tricks to speed the process up (the browser practically crashes before showing all the records) i know i should query it to reduce the number of records selected but i actually need to display 7000…

  • 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-18T04:45:31+00:00Added an answer on May 18, 2026 at 4:45 am

    Turn on output buffering : http://php.net/manual/en/function.ob-start.php

    <?php
    
    ob_start(); 
    
    // do work...
    
    ob_end_flush();
    
    ?>
    

    EDIT

    The following php fetches 10K products and outputs them as a table with no problems in 0.014 seconds.

    <?php
    
    ob_start(); 
    
    $conn = new Mysqli("localhost", "vldb_dbo", "pass", "vldb_db");
    
    $startTime = microtime(true);
    
    $result = $conn->query(sprintf("call list_products(%d)", 10000));
    
    echo "<table border='1'>";
    
    while($row = $result->fetch_assoc()){
     echo sprintf("<tr><td>%s</td><td>%s</td></tr>", $row["prod_id"], $row["name"]);
    }
    
    echo "</table>";
    
    echo sprintf("<br/>Page generated in %s secs",number_format(microtime(true) - $startTime, 6, ".", ""));
    
    $result->close();   
    $conn->close();
    
    ob_end_flush();
    
    ?>
    

    SQL Script

    drop procedure if exists list_products;
    delimiter #
    
    create procedure list_products
    (
    in p_prod_id int unsigned
    )
    begin
        select * from product where prod_id between 1 and p_prod_id;
    end #
    
    delimiter ;
    

    Works fine with 50K records too except runtime dives – Page generated in 0.112902 secs

    EDIT2

    http://phplens.com/lens/php-book/optimizing-debugging-php.php

    An excerpt from the above link:

    An alternate way of speeding the above
    code would be to use output buffering.
    This will accumulate the output string
    internally, and send the output in one
    shot at the end of the script. This
    reduces networking overhead
    substantially at the cost of more
    memory and an increase in latency. In
    some of my code consisting entirely of
    echo statements, performance
    improvements of 15% have been
    observed.

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

Sidebar

Related Questions

Basically if I had a mysql table with columns: id, type, content, version. There
Using PHP / MySQL all encoded up as UTF, we have recently had to
I have had mysql query to check any particular reservations existing in database .
Let's say I had a MySQL database with the following five records in a
Say I had a MySQL table which sorts relationships between users (where there is
Hi all i've had help from bluefleet (BF) with a mysql query which i've
I had a MySQL database with names of roads in it. There is this
I once had a MySQL database table containing 25 million records, which made even
I had an old mysql code where it successfully inserted values into the database.
I had a question in MySQL, did it correctly. But the book code differs

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.