If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem with SELECT JOIN when trying to print out a name once

I have a problem when I'm attempting to print out a specific director name for specific movie. I can print out info such as "title" and "production year" for a specific movie, which is stored in a db-table called "filmer", with this code.

PHP Code:

$sql = "SELECT * FROM filmer where id = $id";

But I also want to be able to print out the specific director in text for the specific movie, and to print out the director name in text (while connecting it to the actual movie) I have to join the db-table "regissorer", which stores the director names in strings. But when I use the following code I cannot make the director name print out only ONCE, it just prints out all of the director names stored in the regissorer-table. The code:

I've also tried this by the way, where I use "regissor_id = $id" instead of "id = $" in the end of the string. But then it prints out one director in some pages, and none in others, and where the names print out it's for the wrong movie anyway, so I just don't know what to do here. :-(