I have a cell that contains values separated by a double pipe. I am trying to search over the contents of this cell with the following, (where 10 is the number to search for) %10, 10%, %10% and 10
My query only seems to be returning 10. none of the other variations. Can someone please advise me why it's not working?
Many thanks in advance. (the SQL query you see below is what is exported from a prepared PDO query statement)
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` = '1'
)
AND `Hat`.`colorId` = '%||10||%'
OR `Hat`.`colorId` = '10||%'
OR `Hat`.`colorId` = '%||10'
OR `Hat`.`colorId` = '10'
)
LIMIT 0 , 30