tiyan 发表于 2018-12-14 12:56:04

php新手之遇到的问题

  写了一个简单的登录验证,居然搞了半天,还各种查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
  

http://s3.运维网.com/wyfs02/M01/8C/15/wKioL1hh242zWtrtAADAviBEUAc190.png
  单引号加$sql,我也是醉了...,去掉单引号,OK!



页: [1]
查看完整版本: php新手之遇到的问题