So I have the following mysql query, which works but not the right way:
SELECT * FROM (`CriteriaItems`) INNER JOIN `Address` ON `Address`.`address_id` = `CriteriaItems`.`address_id` WHERE `criteria_id` = '2' AND `status` = 'published' AND `mls_id` LIKE '%123%' OR `Address`.`address` LIKE '%123%' LIMIT 10
The problem is that I see it returns results that also have "status" = "deleted" and thats because of ``Address.
addressLIKE '%123%'
if I remove this it works, but I need this.
So it suposed to search in the address table as well, but only based on CriteriaItems`.`address_id