Query Builder Where Not Working With Join - 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: Query Builder Where Not Working With Join (/showthread.php?tid=63518) |
Query Builder Where Not Working With Join - wolfgang1983 - 11-08-2015 I am working on my profile display library And I need to be able to have a db->where for my user_permission table. It works fine and displays correct data with out it but would like to find out why when ever I use this line below it does not work PHP Code: $this->CI->db->where('up.user_permission_id', 'u.user_permission_id'); But if I comment that line out I can get data. How could I still use that line and display data. PHP Code: <?php Could you please explain why it return in no information with this $this->CI->db->where('up.user_permission_id', 'u.user_permission_id'); But when I comment it out it works? I am confused. RE: Query Builder Where Not Working With Join - pdthinh - 11-08-2015 (11-08-2015, 11:20 PM)wolfgang1983 Wrote: I am working on my profile display library I don't know the purpose of the where clause you want to use. I see the where clause and the join condition are the same. Maybe you have a mistake? ps: You can use $this->CI->db->get_compiled_select() to review your query in plain text. RE: Query Builder Where Not Working With Join - wolfgang1983 - 11-09-2015 (11-08-2015, 11:54 PM)pdthinh Wrote:(11-08-2015, 11:20 PM)wolfgang1983 Wrote: I am working on my profile display library Thank you now I understand that the are the same so that's why I works with out it. So now I will remove that where cheers. |