How would I write a MySQL error to a file instead of displaying it to the user?
here is what I have so far…
if (!mysql_query($sql_query,$connection))
{
die('Error: ' . mysql_error());
}
echo "Success!";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the error_log function in php for that.
Edit: so in your case this would look like the following (although i would use a different if statement)