"Micheal Corleone" <31***@web.de> kirjoitti
viestissä:dd*************@news.t-online.com...
Hey guys.
Anybody has an idea how to write data from mysql source into a textfile?
Thanks for help.
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 .
mysql_error());
$my_filepointer = fopen("mytextfile.txt", "w");
while($row = mysql_fetch_array($my_result)){
fputs($my_filepointer, implode(';', $row));
}
fclose($my_filepointer);
I'm not gonna debug that, so it may contain errors, but you'll get the basic
idea.
--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <et****************@5P4Mgmail.com>