I have a very simple MySQL query and the “AND” is breaking the query. If I remove “pt.country_id = $country_id” the query executes. Or if I remove “pt.procedure_id = $procedure_id” the query executes. If they are both together with the AND statement, it breaks…???
Here is my query:
SELECT d.row_name FROM data as d
LEFT JOIN procedure_table as pt
ON pt.table_id = d.table_id
WHERE pt.country_id = $country_id AND pt.procedure_id = $procedure_id
Here is the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’ AND pt.procedure_id = 1’ at line 4
Here is my table structure: