CodeIgniter Forums
Active Record : Join syntax precision - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Active Record : Join syntax precision (/showthread.php?tid=44175)



Active Record : Join syntax precision - El Forum - 08-06-2011

[eluser]Gilles_T[/eluser]
Hi,

Simple questions regarding the syntax for db->join :

Should I put a "AS" in

Code:
db->join('mytable_1 AS t1',...) or db->join('mytable_1 t1',...)


Both seem to work.


Thank you for your help


Active Record : Join syntax precision - El Forum - 08-07-2011

[eluser]CodeIgniteMe[/eluser]
You can use the second one,
Code:
db->join('table tbl','conditions')
you only use 'as' on column names in select


Active Record : Join syntax precision - El Forum - 08-08-2011

[eluser]Gilles_T[/eluser]
Thank you