View Full Version : while loops

10-24-2009, 11:10 PM
Ok so im pretty sure im not doing this right but im not entirely sure how i would go about doing it. so here is the problem.

Ive got 3 tables, aquired, songs, bracelets.

aquired consists of

id, uid, bid

and there will be multiple with the same uid but different bid.

SELECT * FROM aquired WHERE uid='123'

now aquired has a field for bid and the bid we will say is 3, this comes into play next.

SELECT * FROM song, bracelets WHERE song.bid='3' AND bracelets.bid='3'

so i need to create a loop that shows the data from song and bracelets based on the aquired bid field, can anyone help me here?

10-25-2009, 12:17 PM
Something like
Select S.column_A,S.column_B, B.column_A,B.column_B from song as S
inner join (bracelets as B, aquired as A)
on (A.uid=123 and S.bid=A.bid and B.bid=A.bid) ?