Yes. The debugging thread link is in my sig... use it to figure out how to debug MySQL queries. Once you've figured that out, post the error that MySQL is telling you, not PHP.
EDIT: On a hunch, you might be mixing up column types with data types - i.e., if "column1" is a numeric type (integer, floating point, etc.), then you CAN NOT compare its contents with strings, like this:
... WHERE `column1`='1234' AND ...
The quotes around 1234 indicate to MySQL that it should treat the data as a string. A correct query for a numeric column like this would look like:
... WHERE `column`=1234 AND ...
Anyway... just a guess. Read more about SQL error debugging and get back to us on the exact MySQL error.