Page 1 of 1

how to creat CSV file with data from MySql By using of PHP?

Posted: Mon Nov 10, 2008 8:09 am
by falcons
Hello every one ...
i am new in PHP and also in this forum .. i have a problem so please help me ..
i want to create a csv file with the data getting from database by using of php..

i wanat to click on "export" link and data will be save in CSV file and download that file into local system ...
so please help me .. thanks

Re: how to creat CSV file with data from MySql By using of PHP?

Posted: Mon Nov 10, 2008 8:18 am
by VladSun
http://dev.mysql.com/doc/refman/5.0/en/select.html
and search for "OUTFILE" in the text ;)

Re: how to creat CSV file with data from MySql By using of PHP?

Posted: Mon Nov 10, 2008 8:36 am
by falcons
VladSun wrote:http://dev.mysql.com/doc/refman/5.0/en/select.html
and search for "OUTFILE" in the text ;)
i wanat to write a code in php

Re: how to creat CSV file with data from MySql By using of PHP?

Posted: Mon Nov 10, 2008 8:40 am
by aceconcepts

Re: how to creat CSV file with data from MySql By using of PHP?

Posted: Mon Nov 10, 2008 8:55 am
by falcons
Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 84

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 85

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 89

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\test-club-asia\index.php:20) in c:\wamp\www\test-club-asia\index.php on line 91

the line 84 t0 91 are
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=your_file_name.xls");
header("Content-Transfer-Encoding: binary ");


so how to remove this error ?
why getting this error?