The mysql_query is returning a boolean value meaning the sql query is probably failing and you're getting a false returned rather than a mysql resource.
Have you checked your query?
You forgot to check whether $num_results is a MySQL result resource. In this case your query errored, so it's FALSE instead.
Re-read the documentation for mysql_query and ensure you program for all possible cases.