Home > Backend Development > PHP Tutorial > 怎么解决PHP错误

怎么解决PHP错误

WBOY
Release: 2016-06-23 14:18:14
Original
903 people have browsed it

登录界面




管理员登录








用户名
密 码




 //接收errno
 if(!empty($_GET['errno'])){
 $errno=$_GET['errno'];
 if($errno==1){
    echo "你的用户名或密码错误";
 }
}
?>


处理界面


浏览器错误信息

回复讨论(解决方案)

$sql = "select password from admin wherename= '$userName'";

注意引号。

$sql = "select password from admin wherename= '$userName'";

注意引号。
谢谢了,在数据库中变量不是不用单引号的吗?为什么$userName要呢

你外边用了双引号  就算里边用单引号也没有问题了,变量依然可以被解析,反之则不行.

mysql里边 字符串要用引号(单双均可)否则会语法错误.

字符串都是需要加引号的

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