Re: DataObject and selecting from multiple tables

From: Date: Mon, 30 Sep 2002 01:16:33 +0000
Subject: Re: DataObject and selecting from multiple tables
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2408@lists.php.net to get a copy of this message
http://pear.php.net/manual/en/packages.database.db-dataobject.filters.php ::query()
Hey guys... i need run a select query that will select from multiple tables and i need an order by on a foreign key... how can i do that with dataobject pears.
It also notes why DataObject never supported multiple tables (as the reason for using dataobjects is to simplify database access, and making a complex API to do multiple table support broke this concept). So basically, you can either send a raw query, into DB_Dataobject, (and use $object->fetch()) or attack it as single tables, eg. and use something like $object->whereAdd('xyz in (' . implode(',',$array_of_Ids).')'); $object->find(); to do your quering.. and have a look at table links to load additional related data. - This is sometimes(not always) faster than crosstable queries Regards Alan

« previous php.pear.general (#2408) next »