CodeIgniter Forums
how convert this sql to db CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how convert this sql to db CI (/showthread.php?tid=30728)



how convert this sql to db CI - El Forum - 05-24-2010

[eluser]minhbu[/eluser]
i have this sql query.Not i want to convert it.
How do i ?

SELECT
*
FROM (`files`)
LEFT JOIN `menu` ON `m_n`.`id`=`files`.`id_parent`
LEFT JOIN `menu` as mn ON `mn`.`id`=`files`.`id_menu`
WHERE

`tap_tin`.`recyclea` = '1'
AND
(
`m_n`.`id` IN ('60', '132', '61', '176', '145', '65', '146', '62', '63', '122', '67', '66', '72', '96', '106', '0', '135', '152', '230', '207', '208', '209', '231', '124', '123', '177', '134', '125', '178')
OR
`mn`.`id` IN ('60', '132', '61', '176', '145', '65', '146', '62', '63', '122', '67', '66', '72', '96', '106', '0', '135', '152', '230', '207', '208', '209', '231', '124', '123', '177', '134', '125', '178')
)


how convert this sql to db CI - El Forum - 05-25-2010

[eluser]WanWizard[/eluser]
Both the alias m_n and tap_tin are not defined in this query, so this is never going to work.