Welcome Guest, Not a member yet? Register   Sign In
MVC confusion redux
#9

[eluser]rogierb[/eluser]
You can use something like:

Code:
SELECT n.*, a.achternaam as a_achternaam, a.voornaam as a_voornaam, a.tussenvoegsel as  a_voorvoegsel,
e.achternaam as e_achternaam, e.voornaam as e_voornaam, e.tussenvoegsel as e_voorvoegsel
FROM nieuws  n
LEFT JOIN personen a
ON n.auteur_id = a.id
LEFT JOIN personen e
ON n.aanpasser_id = e.id

a = author
e = editor

When no author or editor is found, the fields would be empty


Messages In This Thread
MVC confusion redux - by El Forum - 11-26-2009, 09:15 AM
MVC confusion redux - by El Forum - 11-26-2009, 09:21 AM
MVC confusion redux - by El Forum - 11-26-2009, 09:27 AM
MVC confusion redux - by El Forum - 11-26-2009, 10:56 AM
MVC confusion redux - by El Forum - 11-27-2009, 04:36 AM
MVC confusion redux - by El Forum - 11-27-2009, 04:56 AM
MVC confusion redux - by El Forum - 11-27-2009, 05:20 AM
MVC confusion redux - by El Forum - 11-27-2009, 05:53 AM
MVC confusion redux - by El Forum - 11-27-2009, 06:00 AM
MVC confusion redux - by El Forum - 11-27-2009, 06:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB