Forum Moderators: coopster
For example, the connection is Resource id #6 and when I have a SQL error, the query result returns Resource id #7, I think.
What I want to know is, what are these IDs, are they constant, and can I use them as the basis for helpful error reporting? For example, if it's Resource id #7, do I know for sure that it was a problem with executing the query?
I couldn't find an online list of all the types of resource IDs and what they mean.
$result = mysql_query($query) or die(mysql_error());
Try something like that and see if you can't spot your errors. Otherwise post the relevant code and we'll see what we can do.
I was wondering if I can use these resource IDs to know what very specific error has occurred, and display the appropriate error message and information about it.
The current system works fine, and I can establish whether there is a connection problem, database doesn't exist, query is malformed or invalid, etc. I was just wondering if I can streamline it.
It seems that you are going to have to keep your current method of catching errors or find another way to do it. I don't see using the resource ID as a viable way to handle errors.
[edited by: eelixduppy at 3:10 pm (utc) on May 29, 2009]