I have the query listed below, it is out from a PDO statement. Everything in the query works fine, apart from the collectionId = 3 part. Its returning results with other intergers...
I've stared at this for a while and can't spot what is wrong, it all looks fine to me?
SELECT `Hat`.`id` AS `Hat_id` , `Hat`.`hatCode` AS `Hat_hatCode` , `Hat`.`hatCodeOther` AS `Hat_hatCodeOther` , `Hat`.`name` AS `Hat_name` , `Hat`.`description` AS `Hat_description` , `Hat`.`colorId` AS `Hat_colorId` , `Hat`.`collectionId` AS `Hat_collectionId` , `Hat`.`mainPicture` AS `Hat_mainPicture` , `Hat`.`subPicture` AS `Hat_subPicture` , `Hat`.`type` AS `Hat_type` , `Hat`.`featured` AS `Hat_featured` , `Hat`.`published` AS `Hat_published` , `Hat`.`deleted` AS `Hat_deleted`
FROM `modx_hats` AS `Hat`
WHERE (
`Hat`.`published` =1
AND `Hat`.`collectionId` = '3'
AND `Hat`.`colorId` LIKE '%||2||%'
OR `Hat`.`colorId` LIKE '2||%'
OR `Hat`.`colorId` LIKE '%||2'
OR `Hat`.`colorId` LIKE '2'
)
LIMIT 0 , 30