DeepakJ Posted July 30, 2007 Share Posted July 30, 2007 I essentially want to save my entire database onto a CSV file. Can someone explain the process in detail? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/ Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 What is a CRV file? If you want to backup your database, use mysqldump http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html Using a web based solution will be very limited in total dump size. If you want an example/solution, use phpMyAdmin. Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311394 Share on other sites More sharing options...
DeepakJ Posted July 30, 2007 Author Share Posted July 30, 2007 oops comma seperated values. I want to do this inorder to be able to print out a spreadsheet with the data in it. Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311402 Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 I think you mean CSV...comma seperated values http://dev.mysql.com/doc/refman/4.1/en/select.html#id3341530 which yeilds.... SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM test_table; Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311408 Share on other sites More sharing options...
DeepakJ Posted July 30, 2007 Author Share Posted July 30, 2007 Hmm I don't get how you make a csv file like that? What would like a sample script look like? Can you link me to one? Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311413 Share on other sites More sharing options...
DeepakJ Posted July 30, 2007 Author Share Posted July 30, 2007 help please Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311438 Share on other sites More sharing options...
Vizor Posted July 30, 2007 Share Posted July 30, 2007 PHP has an fputcsv() function, not sure if it's part of the standard package though. Quote Link to comment https://forums.phpfreaks.com/topic/62564-how-do-you-create-csv-files-with-phpmysql/#findComment-311460 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.