Jump to content


Help with Complex Code Merging & Liking Tables

  • Please log in to reply
1 reply to this topic

#1 chillexistence

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 16 September 2005 - 03:05 AM

I'm somewhat new to the whole PHP & MySQL database and currently working on a complex project and need some assistance.

I have 3 basic tables,
Table 1 contains the following info
Image_ID, & all related pictures info

Table2 contains the follwoing info
Gallery_ID, Gallery_Title, Gallery_Description

Table3 contains 3 things
ID, Gallery_ID, Image_ID

what i want to do is be able to assign multiple pictures to multiple galleries and some images might appear in several galleries. So of course a sample entry in table 3 might be
ID-1, Gallery_ID-12, Image_ID-16

but where i need the help is I want to be able to add, and update which galleries images are in, so i'm putting all the possible galleries into a drop-down box that allows multiple selections, but I'm not sure how to have it search to see if the image already exists in the gallery, and if not then add it or update it, is there an easy approach without running several queries all at once.

#2 chillexistence

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 September 2005 - 01:06 AM

i'm hacing some issues when linkin two tables together, and i'm not getting the results that i want... like sometimes i get the same result over again for the number of times there is something in the one table....
two tables
table 1 has 3 colums, ID, Image_ID, Gallery_ID
table 2 has bunch of columsb main colum to focus on is image_id,
see what i want to happen is i want it to list all the pictures that appear in lets say Gallery_ID = 2, i can get this querry to work PERFECTLY, but i aslo want to be able to display which pictures DO NOT appear in Gallery_ID = 2, but this i can't get to work for the love of god, and then i aslo want it to show me which pictures do appear in the gallery adn which do not appear in the gallery, but on this querry i get a whole bunch of stuff doubled up

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users