Jump to content

[SOLVED] Help with a SQL query


gloeilamp

Recommended Posts

Hey guys,

 

I'm quite the n00b with MySQL, I know how to make some basic queries but now I'm up for one where my head explodes..  ???

 

The Situation:

 

I've got three tables: guests, filmfairs and fair_guests.

 

The first is just a table with the information about each guest. So with a [you]guestID[you], name, url and a biography.

The second has information about film fairs. [you]filmfairID[/you], title, date and a description.

The last one is a table where the 2 are linked together. In order to add a guest to multiple filmfairs. It has the following records: [you]ID[/you], filmfairID and guestID.

 

Everything works out fine. I can write the checked (I use checkboxes for the guest lists) guests into the "link-table", and I can retrieve the correct guests.

 

But now the problem comes when trying re-add guests to the link-table. I want to generate a list with all the guests EXCLUDING the guests that are allready linked with that particular film fair.

 

I tried several queries but I'm shooting blanks, I've don't have a good idea of where I should go with the query. So my question is, can anyone point me in the right direction?

 

Thank you very much!

 

Edit: for some reason I can't use the underline code because the letter is converted into the word "you". But the text between the [you][/you] is underlined and are the keys of those tables.

Link to comment
Share on other sites

It seems that it is working fine when used in phpMyAdmin, but for some reason when I use it in my PHP coded page I just get all the results from the guest table.

 

But anyway, the query seems to be working! That is great! Thank you very much, I'll try to debug my code first thing tomorrow.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.