Page 1 of 1

MYSQL/PHP: Displaying equipment associated with reservation

Posted: Mon Mar 07, 2011 12:39 pm
by schpanky
So, I have two tables in SQL, one is "reservations" that contains, name, reservation id, etc etc the second table is equipment with the following fields:


id equipmenttype equipmentid isitout reservationid

essentially, the functionality I'd like help figuring out is how to display the full reservation information, so that when reservationid matches an ID field in reservations that is will show up as such (when two rows of equipment are set to reservationid = 3):

ReservationID: 3
Name: Anne Styles
Microphone TA23567 1
Turntable SN24354326 1

Where microphone/turntable are the "equipmenttype"s, TA234567/SN24354326 are the equipmentid's and the trailing 1's are to indicate "isitout" is set to 1 (or OUT)

I haven't been able to figure out an algorhithm or mysql query to display the information like above, it's been hurting my little head :(