hi, i have two tables sessions and location. session :uid,sid,ip have three fields location:lid,address,name,lat,lng i need sql query to select the address from location table where uid equal to lid. plz any one help me find out. thanks
SELECT address FROM location INNER JOIN sessions ON location.lid = sessions.uid Code (markup): If you need to query based on a specific session it would be (assuming that the sid is your user's session_id): SELECT address FROM location INNER JOIN sessions ON location.lid = sessions.uid WHERE sessions.sid = 'USERS_SESSION_ID' Code (markup):