
May 13th, 2004, 08:37 AM
|
|
Registered User
|
|
Join Date: Mar 2003
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Query help..
Ok, here is what I have.
'Pictures' table with picturename field and keywords field
'PictureNames' table with Name field
'PictureNameEntries' table with NameID and PictureID fields
What I have now is a bunch of picture records stored in the 'Pictures' table. Currenlty the keywords field is empty! The 'PictureNames' table holds the names of every person in each of my pictures. Then the 'PictureNameEntries' holds entries that say which name is in which picture. There CAN be multiple names for each picture.
So, what I want to do is get all the names for each picture and insert them into the KEYWORDS field in the 'Pictures' table. Here is the query I started:
UPDATE pictures, picturenames, picturenameentries SET pictures.keywords=picturenames.Name WHERE picturenames.ID=picturenameentries.NameID AND pictures.ID=picturenameentries.PictureID
The problem with this query is that it ONLY GETS ONE NAME per picture. My question is: How can I get all of the entries from the 'picturenameentries' table and insert all of these into my keywords field (separated by a space).
Sorry this is so confusing. Anyone help me?
Thanks,
Ryan
|