DMZ (Datamapper) quick query question |
[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.
[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
[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 |
Welcome Guest, Not a member yet? Register Sign In |