M('country')->where(['cid'=>1])->select();//这个行代码会生成如下sql:
SELECT * FROM `lan_country` WHERE `cid` = 1
//这是正常的,但是下面的
M('country')->where(['cid '=>1])->select();//注意cid后面一不小心加了一个空格,就变成了
SELECT * FROM `lan_country` WHERE `cid` = '1' AND `cid` = 0
M('country')->where(['cid'=>1])->select();//这个行代码会生成如下sql:
SELECT * FROM `lan_country` WHERE `cid` = 1
//这是正常的,但是下面的
M('country')->where(['cid '=>1])->select();//注意cid后面一不小心加了一个空格,就变成了
SELECT * FROM `lan_country` WHERE `cid` = '1' AND `cid` = 0