Click here to Skip to main content
15,910,118 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionPHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist31-Jan-09 19:01
LazyDragonfist31-Jan-09 19:01 
AnswerRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 2:33
EliottA2-Feb-09 2:33 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 4:31
LazyDragonfist2-Feb-09 4:31 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages [modified] Pin
EliottA2-Feb-09 4:34
EliottA2-Feb-09 4:34 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 4:44
LazyDragonfist2-Feb-09 4:44 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 4:46
EliottA2-Feb-09 4:46 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 4:53
LazyDragonfist2-Feb-09 4:53 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages [modified] Pin
EliottA2-Feb-09 5:02
EliottA2-Feb-09 5:02 
Sorry, will show next 3 records starting at record 2

LazyDragonfist wrote:
You said i can go for Google script.Please explain me about it.


$host = 'localhost';
$user = 'mysqlUser';
$pass = 'myUserPass';
$db = 'myDatabase';
$table = 'products_info';
$file = 'export';

$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
mysql_select_db($db) or die("Can not connect.");

$result = mysql_query("SHOW COLUMNS FROM ".$table."");
$i = 0;
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$csv_output .= $row['Field']."; ";
$i++;
}
}
$csv_output .= "\n";

$values = mysql_query("SELECT * FROM ".$table."");
while ($rowr = mysql_fetch_row($values)) {
for ($j=0;$j<$i;$j++) {
$csv_output .= $rowr[$j]."; ";
}
$csv_output .= "\n";
}

$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
?>


modified on Monday, February 2, 2009 11:11 AM

GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 5:13
LazyDragonfist2-Feb-09 5:13 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 5:14
EliottA2-Feb-09 5:14 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 5:15
EliottA2-Feb-09 5:15 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 5:32
LazyDragonfist2-Feb-09 5:32 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 5:54
EliottA2-Feb-09 5:54 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 6:07
LazyDragonfist2-Feb-09 6:07 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 6:09
EliottA2-Feb-09 6:09 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 6:20
LazyDragonfist2-Feb-09 6:20 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 6:23
EliottA2-Feb-09 6:23 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 6:37
LazyDragonfist2-Feb-09 6:37 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 6:39
EliottA2-Feb-09 6:39 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 6:45
LazyDragonfist2-Feb-09 6:45 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
Perspx2-Feb-09 6:55
Perspx2-Feb-09 6:55 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
EliottA2-Feb-09 6:57
EliottA2-Feb-09 6:57 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 7:22
LazyDragonfist2-Feb-09 7:22 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
Perspx2-Feb-09 21:38
Perspx2-Feb-09 21:38 
GeneralRe: PHP and MYSQL Getting all rows (around 10000 rows)of a query in a single html pages Pin
LazyDragonfist2-Feb-09 7:22
LazyDragonfist2-Feb-09 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.