![]() |
Query Problem - 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: Query Problem (/showthread.php?tid=52800) Pages:
1
2
|
Query Problem - El Forum - 06-27-2012 [eluser]tolgay[/eluser] [quote author="InsiteFX" date="1340815690"] Code: $this->db->join('uyeler','uyeler.id = arkadaslar.uid + arkadaslar.fid-1', 'left'); After the query add this and it will show you what is going on. Code: echo $this->db->last_query(); [/quote] SELECT * FROM (`arkadaslar`) LEFT JOIN `uyeler` ON `uyeler`.`id`=(`arkadaslar`.`uid+arkadaslar`.`fid)-1` This code working without ` but codeigniter automaticly add this ` Query Problem - El Forum - 06-27-2012 [eluser]InsiteFX[/eluser] Thats why jmadsen above told you to use the db->query, Active Record escapes all its data. Query Problem - El Forum - 06-27-2012 [eluser]CroNiX[/eluser] Not all queries are possible with active record. The only thing you can do here is use db::query() as suggested, but taking care to manually escape (db::escape()) any input coming from users (which you don't have in that particular query) Query Problem - El Forum - 06-27-2012 [eluser]tolgay[/eluser] I understood.I will use query function |