$arr = array( '0' => array('id'=>1,'openid'=>1); '1' => array('id'=>2,'openid'=>2);)foreach($arr as $key => $val){ select * from 表 where 字段 = $val['openid']}