Hi there.. I have a dating site.. and on the member profile page I need to query two tables to get the info.. so i do it like so:
SELECT members.*, MainProfile.*
From Members
INNER JOIN MainProfile
ON Members.MemberID = MainProfile.MemberID
Where Members.MemberID = @memberID
But I'm going to add the functionality to upload multiple photos to a profile.. up to 5 photos.. and I'm going to display the 5 thumbnails on the profile page.
I'm going to store the photo filenames in a separate table.
So for each photo a member uploads a new row will be created.
What i'm wondering is - how should I best query this? Can I get this info by doing another join on the query above? (and if so, what type of join, as that query is a fixed row one, whereas this will be potentially up to 5 rows from another table). OR is it better to have a separate SQL query all together to get the photo filenames.
Which would be faster? thanks!
SELECT members.*, MainProfile.*
From Members
INNER JOIN MainProfile
ON Members.MemberID = MainProfile.MemberID
Where Members.MemberID = @memberID
But I'm going to add the functionality to upload multiple photos to a profile.. up to 5 photos.. and I'm going to display the 5 thumbnails on the profile page.
I'm going to store the photo filenames in a separate table.
So for each photo a member uploads a new row will be created.
What i'm wondering is - how should I best query this? Can I get this info by doing another join on the query above? (and if so, what type of join, as that query is a fixed row one, whereas this will be potentially up to 5 rows from another table). OR is it better to have a separate SQL query all together to get the photo filenames.
Which would be faster? thanks!