how to make this query? 2 tables, one is limited and the other is not - 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: how to make this query? 2 tables, one is limited and the other is not (/showthread.php?tid=23507) |
how to make this query? 2 tables, one is limited and the other is not - El Forum - 10-13-2009 [eluser]DeaD SouL[/eluser] Hi there.. I have two tables, categories pages so I made this Code: $this->db->select("categories.cat_title, categories.cat_cid, categories.cat_pid, categories.cat_news", FALSE); which will generate this Code: SELECT it works just fine.. but it will get all the categories and pages and i need to get all the categories and just 5 pages for each category.. i think it could be done by sub-select.. i tried.. it just didn't work any help would be appreciated thanks how to make this query? 2 tables, one is limited and the other is not - El Forum - 10-14-2009 [eluser]DeaD SouL[/eluser] Any ideas? Thanks how to make this query? 2 tables, one is limited and the other is not - El Forum - 10-14-2009 [eluser]davidbehler[/eluser] Untested: Code: $this->db->select("categories.cat_title, categories.cat_cid, categories.cat_pid, categories.cat_news", FALSE); how to make this query? 2 tables, one is limited and the other is not - El Forum - 10-14-2009 [eluser]DeaD SouL[/eluser] thanks waldmeister but do you know how many queries it will make? i wanted to make it with one query.. anymore ideas? |