It is still kind of a problem... I don't think I explained well enough.
I need a function that I can call anywhere I want to, to return me the last error that happened in the script. The set_error_handler function won't do that job. I can have the script automatically do certain things on error with that, but I want the errors to be more in my own control.
Most notices I would want the user to never see and the script to keep running, but every now and then there is one I feel the user should be aware of. I want to be able to use this function as I see fit... Such as.
Code:
if($result = @mysql_query($query)){
my_error_handler("notify-user", "pop-up", "feedback");
}
So for the function, I would want to be able to work together an error string such as.
Code:
$errorno = error_no_function_I_need();
$errormsg = error_msg_function_I_need();
$devdesc = "My description for the user.";
$errorstr = "Error Number " . $errorno . ": " .
$errormsr . "<br />" . $devdesc;