So i was searching about DataTables For Bootstrap ( http://www.datatables.net/blog/Twitter_Bootstrap_2 ) and i ended up that they load Data From Json string. The think is that i have more than 5303 Entries... :/ So in order to load this table it will take a lot of time... So any ideas world?
Examples: http://editor.datatables.net/release/DataTables/extras/Editor/examples/bootstrap.html
You have a few options; for a small data-set, say, perhaps only 2 pages, you could probably get away with preloading content and switching between them. However, with 5303/30 ≈ 176 pages, you probably won't do that. JSON & a get query is probably the smallest wait time from a user's point of view. Your script could preload the page either side of the current page, perhaps, so the wait time is minimalised when changing pages.
Well is strange but...
5149 Entried Loaded
Page generated in 0.0391 seconds.
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
require "connect.php";
echo '{
"id": -1,
"error": "",
"fieldErrors": [],
"data": [],
"aaData": [';
$query=mysql_query("SELECT * FROM gatherhistory");
$i=1;
while ($g = mysql_fetch_array($query, MYSQL_ASSOC)) {
$id= $g['GID'];
$time = $g['DATETIME'];
$admin = $g['ADMIN'];
$ip = $g['IP'];
$map = $g['MAP'];
$scorea = $g['SCOREA'];
$scoreb = $g['SCOREB'];
if ($i > 1) { $string .= ','; }
$string .= '
{
"id": "'.$id.'",
"time": "'.$time.'",
"admin": "'.$admin.'",
"ip": "'.$ip.'",
"map": "'.$map.'",
"grade": "X"
}
';
$i++;
}
echo substr_replace($string ,"",-1);
?>
]
}
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
file_put_contents("time.txt","$i Entried Loaded \n\rPage generated in ".$total_time." seconds.");
?>
Do you mean upload to the table (manually) or display information from the table?