1、这是整个表内容:
-----------------------------------------------------------
2、select * from host where id='1' and '1'='1' 和 select * from host where id='1' and '1'='2'
---------
----------------------------------------------------------------------------------------
3、select * from host where id='1' or '1'='1' 和 select * from host where id='1' or '1'='2'
ps:因为没有id=5 且1=2为False,所以为空
----------------------------------------------------------------------------
ps:虽然没有id=5,但是1=1为True,所有全部显示了,这时id参数有没有都无所谓
----------------------------------------------------------------------------
总结一下就是使用and时,所有条件必须同时符合才会显示,否则为NULL,or表示只要有一个符合时,就显示符合的那个条件的数据。