How do I export a table from mySQL database to a txt file?
I've tried the below without any success.
PHP Code:SELECT * FROM mytable INTO OUTFILE 'C:\file.txt'
Printable View
How do I export a table from mySQL database to a txt file?
I've tried the below without any success.
PHP Code:SELECT * FROM mytable INTO OUTFILE 'C:\file.txt'
SELECT * FROM mytable INTO OUTFILE 'C:\\file.txt'
The mysql user will need to have he appropriate permissions to do this.
Thanks but no text file is created and nothing is exported.
This is my code. Have I got the coding correct?
PHP Code:$query = "SELECT * FROM mytable INTO OUTFILE 'C:\\file.txt'";
$result = mysql_query($query);
Are you using two backslashes or one?