I’m trying to join one table to another on one condition, and then the table to another table on another condition. Can you do this and if so what is the correct syntax? I’ve been trying this but it doesn’t work:
$check = $members->prepare("select users.fname, users.lname, groups.groupid, attributes.max
from users
JOIN groups
on users.user_id = groups.userid
where groups.userid = ?
LEFT JOIN attributes
on users.user_id = attributes.userid
where attributes.groupid = ?");
$check->bind_param('ss', $_SESSION['token'][1], $which_group);
$check->execute();
cheers.
Just use……..
AND