Last post Mar 06, 2011 10:32 AM by Chrenner
Mar 06, 2011 09:10 AM|Chrenner|LINK
I am using 3 tables and are trying to get the correct info belonging to the correct id. Like this: I go to a page and here i want to see the information from the 3 tables using a specific id.
I have written this so far in a query:
SELECT Profiles.ProfileID, Profiles.FirstName, Profiles.LastName, ProfileInfos.Height, ProfileInfos.Weight, ProfilePictures.PictureURL FROM Profiles
INNER JOIN ProfileInfos ON Profiles.ProfileID = ProfileInfos.ProfileID
INNER JOIN ProfilePictures ON Profiles.ProfileID = ProfilePictures.ProfileID
WHERE ProfileID = @ProfileID
My problem is that the last line does not work and i am uncertain how to make this work? How to write it correctly that is.
Mar 06, 2011 09:53 AM|nilsan|LINK
Your query seems ok to me, aren't you passing id? Are you getting any error?
Mar 06, 2011 10:32 AM|Chrenner|LINK
Yes, when i try to save it says "Ambiguous column name 'ProfileID'"
If i run the QueryBuilder there is no problem.
EDIT: Fascinating. After adding the last line like this: (Profiles.ProfileID = @ProfileID) it suddenly works. Thanks for taking your time to read and trying to help with my (past) problem.