I'm trying to export data into a csv, using
$query=do_query("SELECT * INTO OUTFILE '".$dir."/".$table."-".date("d M Y H-i-s",time()).".csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM `".$table."`");
However, the data includes commas within some text, and so, it splits it incorrectly.
Is there something I'm missing so that it doesn't ??
E.g.
this text will, on occasion, split into three
And I only want it into one field...
Any ideas ?
[edit]
Would set_magic_quotes_runtime to addslashes to the data work ? Testing at the moment.....