![]() |
Question [DB Query Builder] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Question [DB Query Builder] (/showthread.php?tid=62912) |
Question [DB Query Builder] - -V1cu- - 09-07-2015 Hello guys, I am a bit confused of some functions from the library DB Query Builder. I tried to use db->from, db->join in this way: PHP Code: $this->db->from('table t'); but when i run the query i saw, that this functions add to the table '`' before and after, and the result is something like: PHP Code: FROM `table` `t` Is totally wrong... How i can use this function to get normal results like: `table` t and `table2` t2, and btw this happens and on the select function when i use: t.`column`, it makes `t`.`column`? Thanks. RE: Question [DB Query Builder] - ivantcholakov - 09-07-2015 Code: $this->db->from('table AS t'); RE: Question [DB Query Builder] - -V1cu- - 09-07-2015 (09-07-2015, 11:47 AM)ivantcholakov Wrote: I tried... Result is the same. RE: Question [DB Query Builder] - ivantcholakov - 09-07-2015 Maybe the fake 'condition' breaks the query builder. On current 3.0.2-dev code I tested this: Code: $this->db->from('table AS t'); And here is the produced SQL: Code: SELECT * RE: Question [DB Query Builder] - Narf - 09-08-2015 (09-07-2015, 08:49 AM)-V1cu- Wrote: How's escaping the aliases totally wrong? RE: Question [DB Query Builder] - -V1cu- - 09-08-2015 (09-08-2015, 01:04 AM)Narf Wrote:(09-07-2015, 08:49 AM)-V1cu- Wrote: My bad, i read the documentation and looked on the source library. Solved, thanks! |