Menu
I’m using fwrite to write a log file after a query is executed, and it works, but it basically overwrites the data already in the file. So it only shows the last one.
[code=php]
//check to see if the file is there and is writeable
if(is_writable($filename)) {
if(!$handle = fopen($filename, “w+”)) {
echo “Can not open file ($filename)”;
exit;
}
//write content
if(fwrite($handle, $content) === FALSE) {
echo “Can not write to file ($filename)”;
exit;
}
fclose($handle);
}else{
echo “The file $filename is not writeable”;
}