mysql - Select Multiple rows then join for each row -
i have table stores each location user watching. table called usercity , pictured below example row.

i need select rows user_id='1', , retrieve each location_id's record location table, pictured below:

i not sure start here, here's lame attempt:
select b.* usercity join location b on a.location_id=b.id user_id='1' edit query works 1 record. not sure if work multiple rows.
try below-
select a.*, b.* usercity join location b on a.location_id=b.id user_id=:uid
Comments
Post a Comment