最赞回答 / Lydiar3308665
没用预处理,语句参数相当于把表单提交的数据当参数传递之后拼接成完整语句再查询,在执行的时候执行了别的语句。比如例子中的那个语句,本来是selete * from user where username=[参数1] and password=[参数2],但是拼接了用户传递的参数之后,执行时候是:select * from user where username='' or 1=1 # and password =[参数2],#之后相当于注释了,实际执行的就是select * from user where ...
2016-11-08
select * from user where username='' or 1=1 #' and password=''
其中#代表注释到行尾,变为:
select * from user where username='' or 1=1
where语句恒真
其中#代表注释到行尾,变为:
select * from user where username='' or 1=1
where语句恒真
2016-11-07