Code
TABLE1: [uid] [name] [race]
TABLE2: [rid] [laps] [time [17]] [height] [weight]
TABLE2: [rid] [laps] [time [17]] [height] [weight]
How to select from above tables into an array like below, in one query, given the $id to select from TABLE1?
Code
data (
uid => 23,
name => 'John Q. Public',
race => '1 Mile',
stats => array [18](laps => 'value',
time [19] => 'value',
height => 'value',
weight => 'value')
)
uid => 23,
name => 'John Q. Public',
race => '1 Mile',
stats => array [18](laps => 'value',
time [19] => 'value',
height => 'value',
weight => 'value')
)
The $data['stats'] variable would be made on the fly presumably, and essentially consist of the same data that would result from "SELECT * FROM TABLE2 WHERE rid='$uid'". This is a situation where leftjoin should be used, right?
I've looked over the selectObject* and selectExpandedObject* functions and have read the $joinInfo info at the top of the class, but can't get the syntax right...
Any assistance is appreciated!
Thanks,
- John
--
Photography [20] | PHP [21] | Other [22]
