select * from usertable where (userid=''or ''='') and (password=''or''='')

解决方案 »

  1.   

    select * from usertable where userid=''or (''='' and password='') or''=''两个or 是从左到右
      

  2.   

    是这样吗,不是and的优先级高于or吗,
     我怎么感觉应该是这样呢:
     userid=''or (''='' and password='')or ''=''
      

  3.   

    楼主写的跟我有什么不一样吗select * from usertable where userid=''or (''='' and password='') or''=''
                                 userid=''or (''='' and password='')or ''=''
      

  4.   

    --世纪解析出来的是这样的,相当于没加条件select * from usertable
    select * from usertable where (userid='') or (''='') and (password='') or (''='')
      

  5.   

    对的,因为''='' 必为 真 ,那前面的表达式就不用看了,也为真.在用户名和密码处输入'or''
    不过我把'or''=' 输入进去怎么没用啊? 这样也能进去就好玩了.
      

  6.   

    都起作用,又都不起作用
    (userid=''):相当于没写
    (''=''):恒成立
    (password=''):相当于没写
    (''=''):恒成立