Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display database query results of 100,000 rows or more with HTML?

We're rewriting a website used by one of our clients. The user traffic on it is very low, less than 100 unique visitors a week. It's basically just a nice interface to their data in our databases. It allows them to query and filter on different sets of data of theirs.

We're rewriting the site in Python, re-using the same Oracle database that the data is currently on. The current version is written in an old, old version of Coldfusion. One of the things that Coldfusion does well though is displays tons of database records on a single page. It's capable of displaying hundreds of thousands of rows at once without crashing the browser. It uses a Java applet, and it looks like the contents of the rows are perhaps compressed and passed in through the HTML or something. There is a large block of data in the HTML but it's not displayed - it's just rendered by the Java applet.

I've tried several JavaScript solutions but they all hinge on the fact that the data will be present in an HTML table or something along those lines. This causes browsers to freeze and run out of memory.

Does anyone know of any solutions to this situation? Our client loves the ability to scroll through all of this data without clicking a "next page" link.

like image 891
Ryan Avatar asked Nov 15 '10 16:11

Ryan


People also ask

How to display MySQL table data in web page?

To display the table data it is best to use HTML, which upon filling in some data on the page invokes a PHP script which will update the MySQL table. The above HTML code will show the user 5 text fields, in which the user can input data and a Submit button.

How to show data from database in PHP in table?

php $connect=mysql_connect('localhost', 'root', 'password'); mysql_select_db("name"); //here u select the data you want to retrieve from the db $query="select * from tablename"; $result= mysql_query($query); //here you check to see if any data has been found and you define the width of the table If($result){ echo "< ...

How can we get the number of records or rows in a table using MySQL?

To counts all of the rows in a table, whether they contain NULL values or not, use COUNT(*). That form of the COUNT() function basically returns the number of rows in a result set returned by a SELECT statement.

What else should you define to retrieve the table rows quickly?

SELECT TABLE_ROWS, TABLE_NAME FROM INFORMATION_SCHEMA. TABLES WHERE TABLE_SCHEMA = '{{schema_name}}' ORDER BY TABLE_ROWS DESC LIMIT 1; This will tell you the table name with most number of rows. Replace schema_name with your database before executing query.


2 Answers

I have done just what you are describing using the following (which works very well):

jQuery Datatables

It enables you to do 'fetch as you scroll' pagination, so you can disable the pagination arrows in favor of a 'forever' scroll.

like image 81
Jakub Avatar answered Sep 22 '22 18:09

Jakub


Give a try with Jquery scroll.

Instead of image scroll , you need to have data scroll.

You should poulate data in the divs , instead of images.

http://www.smoothdivscroll.com/#quickdemo

It should work. I wish.

You gotta great client anyway :-)

Something related to your Q

http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html

http://api.jquery.com/scroll/

like image 43
zod Avatar answered Sep 20 '22 18:09

zod