as4s1n said:Would you be able to include mysql_error() as one of the parameters of a function
i.e. writeError(mysql_error())
i.e. writeError(mysql_error())
function writeError($error) {
#Get the page
$page = $_SERVER['PHP_SELF'];
#Get the date it happened
$date = date('r');
#Write to the user
echo "There was an error. The webmaster has already been notified";
#Write the error to a file I will read later
$logstring = "Error on page $page on $date; ERROR: $error";
$fp = fopen("Logs/erros.log","a");
fwrite($fp, $logstring);
fclose($fp);
}