According to documentation,for SELECT and other statements returning resultset,
mysql_query()[
^] returns a
resource on success, or
FALSE on error. Check your query in console or any MySQL gui tool.
Place breakpoint (if you are using some intelligent IDE) or var_dump($query_run) after mysql_query($query) and you will see, what the function call returned.