Passing MySQL Error Message
Posted: Thu Aug 26, 2004 5:18 pm
Hope someone can help point me in the right direction. I have a online form that people fill out. I have the information writing to a database and then emails some administrators.
Basically what I would like is to past a message to the email if the database input fails. So the email still goes out with all the information plus a note saying it wasn't able add the information to the database.
So, obviously I don't want to do a
Been trying to do this
But I can't seam to figure out how to pass the ERROR_MESSAGE to the body of the email. Any help would be greatly appreciated.
Basically what I would like is to past a message to the email if the database input fails. So the email still goes out with all the information plus a note saying it wasn't able add the information to the database.
So, obviously I don't want to do a
Code: Select all
<?php
mysql_query($sql) or die
?>Code: Select all
<?php
mysql_query($sql) or define ("ERROR_MESSAGE", "Could not insert information into database - ".mysql_error()."\r\n");
?>