select * from test where username='张三' and password='*****' or 1='1';
解决方案
1.使用预编译
2.改变验证数据库用户逻辑
select password from test where username='张三';
//看看有没有查询到记录 如果有说明用户存在
if(从数据库查询到的密码==用户输入的密码){
//用户合法
header("admin.php);
}else{
header("error.php");
}