PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
mysql_query($sql) or dieError("Could not add information into database - ".mysql_error()."<br>");
.....
......
function dieError($msg){
$mail_mesasge .= $msg
}
God 4 minutes and a couple of great responses, I love the f**king forum .. BEST ON THE NET PERIOD
Thanks feyd. I actually want to display a successful insert message if everything works and if not dispay the bad message but I think you've pointed me in the right direction with the defined command. I'll see if I can work through it. Thanks again.
I thought about using the mysql_affected rows() but if it failed I wanted to past the reason why it failed into the email so that it could then be forwarded to me.
I ended up writting a if defined statment that worked like a charm. Thanks again feyd