MySQL DUMP as CSV
- by swt83
I've looked around and nothing seems to work:
$file = '/path/to/file.csv';
$cmd = 'mysqldump DATABASE TABLE > '.$file.' --host=localhost --user=USER --password=PASS';
$cmd .= ' --lock-tables=false --no-create-info --tab=/tmp --fields-terminated-by=\',\'';
exec($cmd);
Everything I try creates an empty CSV file. Any ideas? Thanks much.