chillexistence Posted September 16, 2005 Share Posted September 16, 2005 Hi, 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. Quote Link to comment https://forums.phpfreaks.com/topic/2513-help-with-complex-code-merging-liking-tables/ Share on other sites More sharing options...
chillexistence Posted September 24, 2005 Author Share Posted September 24, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/2513-help-with-complex-code-merging-liking-tables/#findComment-8498 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.