functionReadrlist($ids,$page,$size) { global$dsql,$type; $rl=array(); $sql = "SELECT id,uid,username,dtime,reply,msg,agree,anti,pic,vote,ischeck FROM sea_comment WHERE m_type=$type AND id in ($ids) ORDER BY id DESC"; $dsql->setQuery($sql); $dsql->Execute('commentrlist'); while($row=$dsql->GetArray('commentrlist')) { $rl[]="\"".$row['id']."\":{\"uid\":".$row['uid'].",\"tmp\":\"\",\"nick\":\"".$row['username']."\",\"face\":\"\",\"star\":\"\",\"anony\":".(empty($row['username'])?1:0).",\"from\":\"".$row['username']."\",\"time\":\"".$row['dtime']."\",\"reply\":\"".$row['reply']."\",\"content\":\"".$row['msg']."\",\"agree\":".$row['agree'].",\"aginst\":".$row['anti'].",\"pic\":\"".$row['pic']."\",\"vote\":\"".$row['vote']."\",\"allow\":\"".(empty($row['anti'])?0:1)."\",\"check\":\"".$row['ischeck']."\"}"; } $readrlist=join($rl,","); return$readrlist; }
可以看到拼接入sql语句并执行了 AND id in ($ids) 接下来看下Execute函数 位置include/sql.class.php Line224~257