Home >Backend Development >PHP Tutorial >为什么一直提示异常 请人帮小弟我看下

为什么一直提示异常 请人帮小弟我看下

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:52:02785browse

为什么一直提示错误 请人帮我看下
网页提示 Notice: Undefined variable: sql in D:\web\www\cs\login.php on line 8

代码如下
$username=$_POST['username'];
$password=$_POST['password'];
//$password=md5($password);
echo $username,$password;
include('db.php');
$sql='SELECT * FROM `user` WHERE username='$username' and password='$password' limit 1';
echo "$sql";
$query=mysql_query($sql);

?>
------解决方案--------------------
$sql=SELECT * FROM `user` WHERE username='$username' and password='$password' limit 1;

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