Dropdown menu and multiple column foreign key

SuppaMan posted 9 months ago in General

Hi, I have a problem with foreign keys and dropdown-menu. I'll explain better. I have a table with three columns. Two of these are partial primary keys. So the table is in tha attached image 1. I have another table with a lot more columns and the same two as above. They form the foreign key which references the first table. The problem is that if i want to insert a value in a column referenced a dropdown menu is prompted but with only a part of the values in the first table. Specifically, it does not show duplicated values (that can exist, since they're part of a partial primary key). I suspect that the query to obtain the values in dropdown menu isn't correct, infact it does a GROUP BY only for one column instead of the two of PPK. The problem is shown in attached image 2.

I think it's the same problem of the user "werne" in "forum.php?t=11816"

Am i doing something wrong? Thenk you for any help :)

Oh, and sorry for my very bad english :)

2 attachment(s):
  • 1
  • 2

Please login to leave a reply, or register at first.