How to write textfiles with php?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hey guys.

Anybody has an idea how to write data from mysql source into a textfile?

Thanks for help.

Fav pages:
PSP Spiele:
XBOX360 Spiele:

Re: How to write textfiles with php?

Quoted text here. Click to load it

If you honestly say you couldn't figure it out by reading the manual, you  
have bigger problems than that. Anyhow, here's a little example.

$my_result = mysql_query($q = "select * from mytable") or die($q .  
$my_filepointer = fopen("mytextfile.txt", "w");
while($row = mysql_fetch_array($my_result)){
    fputs($my_filepointer, implode(';', $row));

I'm not gonna debug that, so it may contain errors, but you'll get the basic  

SETI @ Home - Donate your cpu's idle time to science.
Further reading at <

Site Timeline