Hi,
I'm trying to join 3 tables, but all I get is a MySQL-syntax error:
The tables:
losmomenten{id (int), user_id(int), los_datum(date), los_time(time), afzender(int),dock(int)}
afzenders {afzender(int), bedrijf(varchar), plaats(varchar), land(varchar)}
users {user_id(int), naam(varchar), plaats(varchar)}
Now I'd like to select almost everthing out of these 3 tables (an export to xls-file) in one query:
What am I doing wrong?
Don't eat yellow snow!
I'm trying to join 3 tables, but all I get is a MySQL-syntax error:
The tables:
losmomenten{id (int), user_id(int), los_datum(date), los_time(time), afzender(int),dock(int)}
afzenders {afzender(int), bedrijf(varchar), plaats(varchar), land(varchar)}
users {user_id(int), naam(varchar), plaats(varchar)}
Now I'd like to select almost everthing out of these 3 tables (an export to xls-file) in one query:
Code:
$select = "SELECT losmomenten.*, afzenders.*, users.* FROM losmomenten RIGHT JOIN afzenders,users ON losmomenten.afzender=afzenders.afzender, losmomenten.user_id=users.user_id WHERE losmomenten.user_id='$user' AND losmomenten.los_datum='$export_datum' ORDER BY losmomenten.dock,losmomenten.los_time";
What am I doing wrong?
Don't eat yellow snow!