edlentz Posted April 8, 2006 Share Posted April 8, 2006 I need to export a table and I cna't seem to get it right. The format I need is: CSV with all fields enclosed with "" and null or empty fields with a 0 or o in them. Can this be done through a query?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/6877-table-export-format/ Share on other sites More sharing options...
fenway Posted April 9, 2006 Share Posted April 9, 2006 You can try the following:[code]SELECT ... INTO OUTFILE '<yourfile>' FIELDS TERMINATED BY "," LINES TERMINATED BY "\n";'[/code]Any conversion of null/blank to zeros will have to be done as part of the select column expression clause explicity. Quote Link to comment https://forums.phpfreaks.com/topic/6877-table-export-format/#findComment-25286 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.