You are doing it completely wrong. First, MySQL extension is deprecated, use MySQLi or PDO_MySQL instead.
Next, mysql_fetch_array requires first parameter to be a resource. But mysql_query sometimes returns a boolean value, for example on error. So it's not a good idea to pass return value of mysql_query directly to mysql_fetch_array function. See examples on mysql_query manual page.
You can also use the function mysql_error to print error message, when mysql_query returns false.
Generally you should test what mysql_query returns before you call function, which works with the query results.
As I mentioned above, it's better to not use this deprecated extension. But you should work the same way as I have described with another extensions too.