A failed query (results in error) returns false. That could be because the connection failed, a column or table name is misspelled, etc. If you're not seeing sql error text on your screen, view source on the page that is returning that error and you should see the SQL error embedded inside of a tag. it will give you a better idea of what is actually wrong. Or just take the query as chrisranjana said and run it in mysql or phpmyadmin to get the error directly without having to view source. That will work for field or table level errors.