query($"/> query($">
Home > Backend Development > PHP Tutorial > php执行mysql语句有关问题

php执行mysql语句有关问题

WBOY
Release: 2016-06-13 12:33:44
Original
923 people have browsed it

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();

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template