![]() |
DMZ (Datamapper) quick query question - 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: DMZ (Datamapper) quick query question (/showthread.php?tid=31935) |
DMZ (Datamapper) quick query question - El Forum - 07-07-2010 [eluser]kungpoo[/eluser] I love the idea of what the Datamapper could do for my projects. I'm trying to get my head around a very basic many-to-many join using the tables students, courses_students and courses. The code to list all courses for a student that I am using is as follows - Code: $s = new Student(); My first question was related to what the profiler shows is happening to the DB - Code: SELECT * FROM `students` LIMIT 1 Code: SELECT * FROM (`students`) Code: SELECT * FROM `courses` LIMIT 1 Code: SELECT `courses`.* Sorry for my ignorance! I seem to just be the to many stuff that is giving me grief. Thanks. DMZ (Datamapper) quick query question - El Forum - 07-07-2010 [eluser]kungpoo[/eluser] This seems to be more like what I want Code: $s = new Student($id); but still getting 2 select * limit 1 extra queries? Code: SELECT * FROM `students` LIMIT 1 DMZ (Datamapper) quick query question - El Forum - 07-07-2010 [eluser]kungpoo[/eluser] OK I didn't read around this enough... Sorry for wasting everyone's time! http://www.overzealous.com/dmz/pages/prodcache.html |