thinkphp の配列クエリの問題
thinkphp のクエリ条件は
$map['id'] = I('get.id');<br />$map['cid'] = i('get.cid');<br />$m->where($map)->find();
SELECT `id`,`title`,`pic` FROM `news` WHERE `id` = null AND `cid` = null LIMIT 0,12
$map['id'] = I('get.id');<br />$map['cid'] = i('get.cid');<br />$map = array_diff($map, array('')); //过滤掉空元素<br />$m->where($map)->find();