I said I'd write a good reply on this topic for the stickies, so here it is.
mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
If you look at the manual for the mysqli_fetch_array function, you will see it expects to recieve a mysqli_result object, just like the error specifies. Instead, you have given it a boolean value. Looking at the code, you can see that you are trying to use the returned value from a mysqli_query call.
The manual page for mysqli_query it tells you very clearly what it returns.
So, mysqli_query returned false because your query failed. The error you're getting is caused by not checking to see if your query was successful and returned a valid mysqli_result object before trying to use that object. The manual shows examples of how to check for this, but the easiest way for debugging is:
$sql = "Your SQL statement here";
$result = mysqli_query($sql) or trigger_error("Query Failed! SQL: $sql - Error: ".mysqli_error(), E_USER_ERROR);
This will display the error message along with your entire query. You should put your queries into strings so you can easily echo them for debugging. In the long term, you should come up with more sophisticated error handling but this is a quick fix for debugging.
Once you have the error and the SQL statement, you can start to debug your code.
Edit: Updated to use trigger_error per premiso's advice, thanks!