[SOLVED] fwrite() doesn't append the ouput of
Posted: Wed May 07, 2008 2:35 pm
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);
}
?>
//////////////////// \\\\\\\\\\\\\\\\\\\\\
////////////// \\\\\\\\\\\\\\\\
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);
}
?>
//////////////////// \\\\\\\\\\\\\\\\\\\\\