Moin Moin!
Wie und welche der beiden Möglichkeiten ist "besser" um z.b. einen Login zu realisieren, welcher sich aus username + domain zusammen setzt.
Im Sinne einer Mail-Adresse?
Nicht künstlich zerlegen. Die Mail-Adresse ist der Name des Accounts.
Tabelle User:
id | email | ...
---+-----------------+----
1 | joe@example.com | ...
2 | ben@invalid.tld | ...
3 | me@localhost | ...
Im Sinne einer Anmeldung à la Windows, d.h. Username, Password, Logon-Domain?
Entsprechend Deinem ersten Beispiel. Jeder Account ist eindeutig einer Domain zugeordnet, Accounts ohne Domain oder mit mehreren Domains sind nicht sinnvoll, daher ist eine n:m-Hilfstabelle auch nicht sinnvoll.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so".
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so".