我需要选择登录茶(老师(的记录 我对此做了很多研究,但遇到了一个又一个的障碍,所以我真的希望你在这方面有所帮助,非常感谢!
这是我的代码:
$query=mysqli_query($conn, "select * from `app` left join `par` on par.par_id=app.par_id
left join `tea` on tea.tea_id=app.tea_id
ORDER BY app_id DESC");
你的 where 子句需要说明你匹配的列
$query=mysqli_query($conn, "select *
from app
left join par on par.par_id=app.par_id
left join tea on tea.tea_id=app.tea_id
where tea.tea_id = '".$_SESSION['tea_id']."'
ORDER BY app_id DESC");
你的 where 条件语法是错误的
select * from app
left join par on par.par_id=app.par_id
left join tea on tea.tea_id=app.tea_id
where tea.tea_id = '".$_SESSION['tea_id']."' ORDER BY app_id DESC