if (!$handle = fopen($filen, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $this->Query) === FALSE) { echo "Cannot write to file ($file)"; exit; }