我有这个疑问,
$query = 'SELECT * FROM users where id ="'.$_SESSION['user_id'].'"';
我的问题是我不知道如何将它与另一个表连接起来......使用另一个 where 或“On”子句......
你能帮我看看这个语法吗?
它应该是SELECT $query FROM users,retailer ON $query.user_id=retailer.user_id
......
"SELECT users.first_name, retailer.date
FROM users AS users
LEFT JOIN retailer AS retailer ON users.user_id=retailer.user_id
WHERE users.user_id=" . $_SESSION['user_id']
谢谢!