Aside from writing the wrong query and not having permissions to access a table, when mysql_query
returns false? Are there any other cases?
Thank you for your comment.
I am sure there is absolutely no need to dig into such details.
A thing you really need is error message which you can read and thus get informed of the particular problem.
So, it seems that mysql_error()
function is really what you're looking for.
$res = mysql_query($sql) or trigger_error(mysql_error()." in ".$sql);
looks sufficient enough.