Otóż posiadam sobie takie tabelki:

gdzie:
<pk> - primary key
<ix> - index
i niestety nie wiem jak je powiązać relacjami w taki sposób by:
* tabelka menu była powiązana z menuName
* tabelka languages też była powiązana z menu name
i teraz dla langName "pl" (z tabelki languages) i dla siteName "about" (z tabelki menu) chciałbym przypisać odpowiednią wartość realName (tabelka menuName)
np.
languages
Kod
+-------+------------+-----------+--------------+
|idLang | langName | langDesc | langDefault |
+-------+------------+-----------+--------------+
|1 | pl | polski | 1 |
|2 | en | english | 0 |
|3 | de | deutsch | 0 |
+-------+------------+-----------+--------------+
|idLang | langName | langDesc | langDefault |
+-------+------------+-----------+--------------+
|1 | pl | polski | 1 |
|2 | en | english | 0 |
|3 | de | deutsch | 0 |
+-------+------------+-----------+--------------+
Menu
Kod
+--------+--------+---------------+-------+--------+
| idMenu | type | siteName | isSsl | isAuth |
+--------+--------+---------------+-------+--------+
| 1 | | news | 0 | 0 |
| 2 | | about | 0 | 0 |
+--------+--------+---------------+-------+--------+
| idMenu | type | siteName | isSsl | isAuth |
+--------+--------+---------------+-------+--------+
| 1 | | news | 0 | 0 |
| 2 | | about | 0 | 0 |
+--------+--------+---------------+-------+--------+
MenuName
Kod
+----+------------+------------+---------------+
| id | langName | siteName | realName |
+----+------------+------------+---------------+
| 1 | pl | news | Aktualności |
| 2 | en | news | Latest News |
| 3 | de | news | Aktualität |
| 4 | pl | about | O nas |
| 5 | en | about | About Us |
| 6 | de | about | Über uns |
+----+------------+------------+---------------+
| id | langName | siteName | realName |
+----+------------+------------+---------------+
| 1 | pl | news | Aktualności |
| 2 | en | news | Latest News |
| 3 | de | news | Aktualität |
| 4 | pl | about | O nas |
| 5 | en | about | About Us |
| 6 | de | about | Über uns |
+----+------------+------------+---------------+
no właśnie i teraz jakich użyć relacji między tymi trzema tabelami tak by było prawidłowo ?
Czy da się w tabelmi menuName zrobić tak by wartości raz użyte się nie powtarzały ale np.
prawidłowo:
pl news
en news
pl about
en about
nieprawidłowo:
pl news
en news
pl news
en about
en about
czy da się to z poziomy mysql'a zabezpieczyć czy raczej zostaje php ?
Będę wdzieczny za odpowiedź!
Najbardziej mi zależy na relacjach by tabele poprawnie połaczyc.
Pozdrawiam