为什么一直提示异常 请人帮小弟我看下
程序员文章站
2024-02-07 21:17:28
...
为什么一直提示错误 请人帮我看下
网页提示 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”;
网页提示 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”;
相关文章
相关视频