hi......
im using this command to take the data from my table in mysql
$sql1="SELECT * into outfile '/tmp/text' from websites ";
and when i add a new data to the table and try to use this command a gain i it give me this error
Error: File '/tmp/text' already exists
but i must overwrite on the same file text so any body have any idea
exporting data from mysql database
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
You'll need to delete the file using unlink() before calling the query.http://dev.mysql.com/doc/refman/5.0/en/select.html wrote:file_name cannot be an existing file, which among other things prevents files such as /etc/passwd and database tables from being destroyed.
- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
Refer to this url if you're loading data into mysql from text file :
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html