while ($a3 = mysql_fetch_array ($a2)) {
if ($a3[0] != "0") {
$file = fopen("file.txt", "w");
fputs($file, "$a3[0]");
fclose($file);
}
}
When using this code, the file.txt is only left with the last entry. It must erase the file.txt every time fputs is executed. How can I make it so that it does not keep overwriting the whole file?