![]() |
Bidimensional array in model - 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: Bidimensional array in model (/showthread.php?tid=42552) |
Bidimensional array in model - El Forum - 06-10-2011 [eluser]Juan Velandia[/eluser] Hello Everyone, I´ve been dealing with this for quite a while I have this function in a model wich joins two tables. Code: function get_section_articles() But when I try to get the data from the cms_section.placeholder=2 it gets only one section and it´s articles. In the database there are more than 3 sections with cms_section.placeholder=2. Any ideas? thanks in advance Bidimensional array in model - El Forum - 06-10-2011 [eluser]Akinzekeel[/eluser] Maybe this helps: Remove Code: $this->db->where('cms_section.placeholder','2' ); Replace Code: $this->db->join('cms_section','cms_section.url_section = cms_article.url_section','right'); with Code: $this->db->join('cms_section','cms_section.url_section = cms_article.url_section AND cms_section.placeholder = 2','right'); Edit: Forgot to ask - is the problem even your SQL query or is it the array construction? Bidimensional array in model - El Forum - 06-10-2011 [eluser]Juan Velandia[/eluser] Hello sHiRoKKo1337 I think it´s the sql, I´ll check your suggestion.. thanks a lot! |