[eluser]edelcal[/eluser]
Hey guys. I was developing an SQL query and found out that i need parentheses for retrieving to correct data.
The query would look like this (i didnt show the joins):
SELECT * FROM (`media`)
WHERE `galleries`.`galleryShow` = 'y'
AND `galleries`.`galleryType` = 'video'
AND (`games`.`gameName_en` LIKE '%book%'
OR `games`.`gameName_es` LIKE '%book%'
OR `game_platform`.`keywords` LIKE '%book%' )
ORDER BY `mediaDate` desc
So i dont know how to enter a paretheses after the AND when i want to have some ORs between them, like in the example. With Active Records i can use: $this->db->or_like('games.gameName', '%book%' );
but i would like to be able to insert parentheses before and after all the OR querys.
Hope some of you guys have any idea for doing this.
Many thanks