I am tring to change my current MySQL connections from the standard:
mysql_connect(localhost,username,passowrd) or die ("some error message"
To something a little more convient for tracking down problems on my site. This is what I have come up with
mysql_connect(localhost,username,passowrd) or send_error("databse connection, problem", mysql_error(), "index.php"
send_error() is a function in my library set that takes in multiple variables and emails me the information sent to it.
function send_error($subject,$message,$redirect){
mail("mhawks@carroll.edu",$subject,$message);
header ("Location: $redirect"
exit();
}
The send_error() function is being called, and the email is going out with the right subject line, and the user is being redirected properly, but the body of the email is not containing any informaion. I am tring to pass the mysql_error() inforation into it, but it dosent seem to work ... anyone see an obvious reason why this shouldnt work, or if there is a better way to accomplish what my basic goals are?
what other options to the "or die("message"" do we have on mysql_connect?
mysql_connect(localhost,username,passowrd) or die ("some error message"
To something a little more convient for tracking down problems on my site. This is what I have come up with
mysql_connect(localhost,username,passowrd) or send_error("databse connection, problem", mysql_error(), "index.php"
send_error() is a function in my library set that takes in multiple variables and emails me the information sent to it.
function send_error($subject,$message,$redirect){
mail("mhawks@carroll.edu",$subject,$message);
header ("Location: $redirect"
exit();
}
The send_error() function is being called, and the email is going out with the right subject line, and the user is being redirected properly, but the body of the email is not containing any informaion. I am tring to pass the mysql_error() inforation into it, but it dosent seem to work ... anyone see an obvious reason why this shouldnt work, or if there is a better way to accomplish what my basic goals are?
what other options to the "or die("message"" do we have on mysql_connect?