I wonder if someone could actually show me a sample PHP code on how can i export around 50 tables in a MySQL database to a CSV file. My database name is \"samples\" and i ha
This is how to export 1 table directly from mysql terminal. I've just used the tmp directory as an example buy you can change the path to anything you like:
select * from product where condition1 order by condition2 desc INTO OUTFILE '/tmp/myfile.csv' FIELDS TERMINATED BY ',' ESCAPED BY '\\' OPTIONALLY ENCLOSED BY '"';
or with php and mysqli: