Let me get right to the point. What I have is a query that searches if a row exists and if it doesn't I don't want the script to execute. Originally I thought I could just use something like:
("SELECT * FROM whatever WHERE this=that") or die("Error Message");
However, I ran into a problem that I didn't expect. The thing is when I use die(mysql_error()) it reports a "Resource ID #4" for the query because the query returns nothing. However, when I don't use the mySQL error then it ignores the die command. I tried running some other sample commands in phpMyAdmin trying to figure this out and I can't figure out how to tell the query to return a null or false value if there is no result to return. I mean I am assuming the reason the die command isn't working is because there is nothing wrong with the query because technically speaking the query just returns 0 results.
Now I realize I could probably just use another if statement using mysql_num_rows to figure out if anything was returned, but I am more curious to find out if there is a way to do this within the mySQL query statement that would return something useful so that I could break the if statement and possibly display my own error message instead of the mysql resource id one.