请教一个foreach循环遍历的问题。
<?php$db = mysql_query("select id,type,title,pic,adate from ".mainTablePre()."content where type=3 order by adate desc limit 0,4");
while( $rs = mysql_fetch_array($db) ){
if($rs){
echo $rs[2]."<br />";
}
}
?>
这样的while语句改写成foreach应该要怎么写呢?