Right, I'd looked up those functions, but they don't allow you to get an error message related to an error number, they only allow you to get an error number related to the most recent error, or an error message related to the most recent error.
Here's the situation: I've got a script that tries to perform a database operation. The script is called from a page -- I'll call it page X -- and then re-directs back to page X immediately. If there's no error, it simply redirects; if there is an error, it redirects with "?error=$errno" appended to the URL. The problem is that mysql_error() and mysql_errno() don't seem to produce any output when they're called at the top of page X. So what I'd like to do is get the error message associated with the error number so that I can print it out.
I know that I could write a function that would get the error message before redirecting, and change every space character into a + sign and then encode the whole mess into the URL, but that seems like overkill. It seems like there has to be a function out there somewhere that translates an error number into an error message!
Thanks,
Rich