Welcome to PHPBuilder! When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags (not the generic CODE tags) as they make your code much easier to read and analyze.
As for your problem, you need to debug the SQL query since it is failing. As the error message states, you're passing mysql_fetch_array() a boolean instead of a MySQL resource. That must mean that [man]mysql_query/man returned a boolean response which, as the manual states, means that an error occured and the query has failed.
To figure out why, you should retrieve the MySQL error message. If [man]mysql_query/man returns FALSE, use [man]mysql_error/man to get this message to aid in debugging the query.
Also, user-supplied data should never be placed directly into a SQL query else your code will be vulnerable to SQL injection attacks and/or just plain SQL errors. Instead, you must first sanitize the data with a function such as [man]mysql_real_escape_string/man (for string data).