query($sql);"/> query($sql);">

Home  >  Article  >  Backend Development  >  php执行mysql语句有关问题

php执行mysql语句有关问题

WBOY
WBOYOriginal
2016-06-13 11:39:49810browse

php执行mysql语句问题
$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();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn