Topic: Fetching data from three tables.
I'm trying to fetch data from three tables with one single query, but I haven't really succeeded.
I've tried:
SQLsats = "SELECT gastbok.gID, gastbok.inlagg, gastbok.skickat, members.id, members.user, members.kon, members.inloggad, members.alder, "
SQLsats = "members.bor, members.land, bilder.path FROM gastbok INNER JOIN (members INNER JOIN bilder "
SQLsats = "ON (gastbok.fran = bilder.id)) ON gastbok.fran = members.id WHERE gastbok.till = " & Request.QueryString("id") & " ORDER BY gID DESC LIMIT 200"
and
SQLsats = "SELECT gastbok.gID, gastbok.inlagg, gastbok.skickat, members.id, members.user, members.kon, members.inloggad, members.alder, "
SQLsats = "members.bor, members.land, bilder.path FROM gastbok, members, bilder "
SQLsats = "WHERE (gastbok.fran = bilder.id) AND (gastbok.fran = members.id) AND gastbok.till = " & Request.QueryString("id") & " ORDER BY gID DESC LIMIT 200"
but all I get is errors. Seeing as I get them, I am doing something awfully wrong. This is my first time doing joins on more than two tables :/