$id=1; 这个是确定没问题
这个执行就错误
$sql=update admin set pass='$pass1' where id=$id;;
$mysql=new mysqlhelper();
$count=$mysql->query($sql);
$mysql.close();
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 '' at line 1
这个执行就正确
$sql=update admin set pass='$pass1' where id=1;;‘
$mysql=new mysqlhelper();
$count=$mysql->query($sql);
$mysql.close();
回复讨论(解决方案) 打印出 $sql 就知道了
$id=1; 这个是确定没问题
这个执行就错误
$sql=update admin set pass='$pass1' where id=$id;;
$mysql=new mysqlhelper();
$count=$mysql->query($sql);
$mysql.close();
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 '' at line 1
这个执行就正确
$sql=update admin set pass='$pass1' where id=1;;‘
$mysql=new mysqlhelper();
$count=$mysql->query($sql);
$mysql.close();
红色部分有个分号
$sql=update admin set pass='.$pass1.' where id=$id;; 改成这个试试
2l正解 不需要加分号 版大说的是解决此类问题的共通办法:查询遇到问题 先打印出sql语句检查一下 十有八九就明白了./
测试了下,还真是这个问题
同意一楼的的,打印sql语句就知道了
$sql=update admin set pass='.$pass1.' where id=.$id;