Having trouble with this query:
UPDATE table1 t1 SET t1.custom_id=(SELECT t2.custom_id
FROM table2 t2 WHERE LOWER(t1.first_name)=LOWER(t2.first_name)
AND LOWER(t1.last_name)=LOWER(t2.last_name)
AND (t2.zip1 LIKE CONCAT('%',t1.zip,'%')
OR t2.zip2 LIKE CONCAT('%',t1.zip,'%')) LIMIT 1)
I triple-checked that php variables match the field names. When I split it into multiple queries update works fine.