On Thu, 2008-12-11 at 13:56 -0500, tedd wrote:
> At 1:48 PM -0500 12/11/08, Robert Cummings wrote:
> >On Thu, 2008-12-11 at 13:27 -0500, Bastien Koert wrote:
> >  > On Thu, Dec 11, 2008 at 12:56 PM, tedd <tedd.sperl...@gmail.com>
> >
> >  > > Does anyone have any example code to show me the actual syntax?
> >
> >  > Joins should allow you to pull the data from the table in one query
> >
> >You want to be careful using joins though. If you were to pull all that
> >data in one shot using joins you would create a large data transfer
> >mostly containing redundant data.
> >
> >Cheers,
> >Rob.
> 
> Rob:
> 
> Good point. Maybe my old way of doing that was the best. Simply get 
> the ID's needed from one table and then open the necessary tables 
> accordingly. In other words, stop worrying about the number of times 
> I'm going to the store to buy things because going once might result 
> in the things being too heavy for me to carry home -- if that makes

No, it's still good to think about the number of trips. For instance if
you are getting the number of students in attendance you may as well
join on the student table to get their individual data "if you need it".
Similarly, if for whatever reason you have 10 student IDs, but not the
student information itself, but you need to get said information... you
can just select them all in one query using an IN( id1, id2, ... )
clause.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to