how to extract data from MYSQL database to a text file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

how to extract data from MYSQL database to a text file

Post by madhu »

Hi all,

can any body guide "how to extract data from MYSQL database to a text file"??

i know how to connect to mysql using php , performing all mysql operations and fetching data from mysql using php.

Now problem is how to store that data in a text file??

Please help me how to solve this issue.

waiting for your valuable replies

Regards
Madhu
parveen.sehrawat
Forum Newbie
Posts: 8
Joined: Wed Aug 09, 2006 6:50 am

hi

Post by parveen.sehrawat »

the ans 4 ur query is:::

u can just rt. click on database , select the option "Export database as sql dump".
Here u select the radio button structure and data. Now ur file is created which u can open in notepad.
jito
Forum Commoner
Posts: 85
Joined: Sat Mar 25, 2006 4:32 am
Location: india

Post by jito »

you want to save your query result in a text file - is this the problem?
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post by madhu »

i know that we can export the data from mysql database using "export" option.

but now problem is am trying to get data from mysql databse and store in a text file using php programatically
jito
Forum Commoner
Posts: 85
Joined: Sat Mar 25, 2006 4:32 am
Location: india

Post by jito »

just check file handling in php- follow the manual.
there are some functions fopen(),fwrite(), fclose() you need for this purpose.
Post Reply