Comments on: Dump MySQL table into CSV file http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: Abhishek Tiwari http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-21207 Tue, 17 Jan 2012 06:41:15 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-21207

this is working but I also want the coloum header with the data can any one tell me the code that how can i export data with coloum name from mysql to .csv format

Reply  |  Quote
]]>
By: thiyagi http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-18417 Thu, 03 Feb 2011 15:50:28 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-18417

thanks guys,…

Reply  |  Quote
]]>
By: ryan http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-14618 Sun, 14 Mar 2010 19:58:38 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-14618

hi, i would like to know how to include the column names into the csv file

Reply  |  Quote
]]>
By: kamlani http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-14530 Mon, 08 Mar 2010 14:29:49 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-14530

@ Hilton Becker:

write the full path in the file field

Reply  |  Quote
]]>
By: Hilton Becker http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-13048 Mon, 24 Aug 2009 13:17:58 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-13048

@ Max:
Hello,

I would like to know how to change the location (path) where the file is saved. Is this possible? If so what do i need to do.

many thanks in advance
Hilton

Reply  |  Quote
]]>
By: Kal http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-12718 Thu, 09 Jul 2009 16:07:54 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-12718

Hi all, my script is running, thanks for the ideas. But I need to rewrite the file with the same name each time. How can I do that? Thanks!

Reply  |  Quote
]]>
By: Max http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-11921 Sat, 04 Apr 2009 23:00:47 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-11921

In linux the place where this file is /var/lib/mysql/database_name/file.csv

Reply  |  Quote
]]>
By: Ivan http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10267 Sat, 27 Sep 2008 15:36:36 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10267

Hi! Sean asked this by email as well and the problem is that the correct “dump” method name is

$mid_excel->WriteSQLDump($query, ‘ceementor’, ‘mentoruser’, ‘*******’, ‘mydbs1.ce.gatech.edu’);

That will do the trick. Sorry about the confusion.

Regards,
Iván

Reply  |  Quote
]]>
By: Sean http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10259 Thu, 25 Sep 2008 19:15:37 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10259

I can’t seem to get Ivan’s IAM_XLS to work. When I modify the example.php file and access it via my website I get the following:

Fatal error: Call to undefined method IAM_XLS::dump() in /export/home3/www/mentor/admin/example.php on line 8

Yes I do have the iam_xls.php file in the same directory and have modified it to use my db settings, userid, password etc…

Here is what my example.php file looks like:

dump($query, ‘ceementor’, ‘mentoruser’, ‘********’, ‘mydbs1.ce.gatech.edu’);
?>

If anyone could help it would be greatly appreciated!

Thanks,

[quote comment=”6382″]Hi! I had the same problem and I developed 2 PHP classes to solve the problem.
One is IAM_XLS, which exports data in Excel’s BIFF format. The class supports only text, integer and float value types but it’s kind of handy when all you need to do is dump a query result. It also has a “dump” function that does just that for you.

The other, named IAM_CSVDump, does the same as your SQL statement but adds a couple of features that make downloading the file a nicer experience.

Kind regards,
Iván[/quote]

Reply  |  Quote
]]>
By: boardtc http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10119 Wed, 10 Sep 2008 15:52:01 +0000 http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/#comment-10119

Perfect. Note the default location the file is saved in windows is, eg:
C:\Program Files\MySQL\MySQL Server 5.0\data\myDatabaseName

Reply  |  Quote
]]>