Using php I understand that false is the same as 0, so when checking my select query results, if I have 0 results mysql_num_rows($result) will evaluate to false - this i understand, what will the function evaluate to if I have an sql error.
$sqlQuery="SELECT userID, userName, password, role From User WHERE userName=$userName;"
$result=mysql_query($sqlQuery);
if(mysql_num_rows($result)){
#I have results so process
} else #do I have an error or do I just have no results
I need to return a meaningful result from the query i.e. "no such user" or details of the sql error, I do not wish to use mysql_query($sqlQuery) or die().
I have searched the web and can't find a conclusive answer. Any help would be greatly appreciated.
Amanda