![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, the following sql is not returning result I had hoped for (obviously my problem and not the sql). |
|
I would like to return an array as follows where booking and asset tables are joined on weeknumber and only results for the current weeknumber (php variable) are shown [1] => Array ( [teacher] => CM [subject] => Applied Engineering [yeargroup] => 12 [location] = [quantity] = ) $sql .= "SELECT booking.*,asset.location,asset.quantity FROM booking "; $sql .= "LEFT JOIN asset ON booking.weeknumber = asset.weeknumber "; $sql .= "AND booking.room = asset.room "; $sql .= "AND booking.period = asset.period "; $sql .= "AND booking.weeknumber = '$week_number'"; |
#3
| |||
| |||
|
|
Hi, the following sql is not returning result I had hoped for (obviously my problem and not the sql). I would like to return an array as follows where booking and asset tables are joined on weeknumber and only results for the current weeknumber (php variable) are shown [1] => Array ( [teacher] => CM [subject] => Applied Engineering [yeargroup] => 12 [location] = [quantity] = ) $sql .= "SELECT booking.*,asset.location,asset.quantity FROM booking "; $sql .= "LEFT JOIN asset ON booking.weeknumber = asset.weeknumber "; $sql .= "AND booking.room = asset.room "; $sql .= "AND booking.period = asset.period "; $sql .= "AND booking.weeknumber = '$week_number'"; Many thanks, Chris |
![]() |
| Thread Tools | |
| Display Modes | |
| |