id 是唯一的,MySQL 做查询,你的 id 字段是主键不是,有没有建立索引,id 是主键是自动增加 。 顺序 1,2,3,4,5 ......不是主键不是自动增加 。顺序 1,200,38 ......如果 id 是主键并且自动增加,对 dmlx 也做索引,然后再查询。 $str_sql="select * from dddd where id='".$id."'" and dmlx=1 ;
调试欢乐多
例如$s = "select * from abc where a='".$a."' and b like '%".$b."%'"
肯定比
$s = "select * from abc where b like '%".$b."%' and a='".$a."'"
好