
April 26th, 2004, 01:11 AM
|
|
|
|
Join Date: Apr 2007
Location: Fort Bragg, CA, USA
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PEAR Db_DataObject: joining and grouping
php 4.3.6 redhat 9
I'm excited about using DB_DataObjects classes to interact with my database. Trouble
is that there seem to be no resources/tutorials that deal with complex joins. The PEAR manual suggests you are better off feeding the raw query into $object->query(); Once you do that, however, how do you extract the result and render say:
I have tables for user, address, city, and county. I want to take my query and
County
City
User
User
User
City
User
County (etc...)
Something like:
php Code:
Original
- php Code |
|
|
|
<?php foreach($counties as $county => $cities) { $out .= "$county<br />"; foreach($cities as $city => $users) { $out .= "$city<br />"; foreach($users as $user) { $out .= "$user"; } } } return $out; ?>
|