写了一个简单的登录验证,居然搞了半天,还各种查mysqli num_rows,还以为是num_rows出问题,后面在如图所示后面加了条是否存在结果集的判断,运行下,错误结果出来了,就明白是$sql有问题。
错误显示:You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near ‘$sql‘ at
line 11064
单引号加$sql,我也是醉了...,去掉单引号,OK!
时间: 2024-10-12 23:27:06