[SOLVED] fwrite() doesn't append the ouput of

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
Janco
Forum Commoner
Posts: 37
Joined: Fri Apr 25, 2008 2:51 am

[SOLVED] fwrite() doesn't append the ouput of

Post by Janco »

Does anybody know how to make fwrite() append output from mysql_fetch_array() (78 rows with about 2500 records) to linux text file without overwriting the previous line?

////////////// \\\\\\\\\\\\\\\\
while ($row=mysql_fetch_array($result)) {
$var1=$row['col1'];
$var2=$row['col2'];
$var3=$row['col3'];
.
.
.
$var78=$row['col78'];

$file = "file";
$fo = fopen($file, 'w');
$string = "$var1,$var2,$var3,..........$var78\n"
fwrite = ($fo, $string);
fclose($fo);
}
?>
//////////////////// \\\\\\\\\\\\\\\\\\\\\
Last edited by Janco on Tue May 27, 2008 1:04 am, edited 1 time in total.
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: fwrite() doesn't append the ouput of mysql_fetch_array()

Post by EverLearning »

Check your other topic.
Post Reply