老师,怎么把从数据库中读取出来的图片分页显示啊!
$sql1="select albumPath from jiahe_album where rid='{$id}'"; $result1=mysql_query($sql1); $num = mysql_num_rows($result1); $pageSize=1; $totalPage=ceil($num/$pageSize); $page=@$_REQUEST['page']?(int)$_REQUEST['page']:1; $offset=($page-1)*$pageSize; if($page<1||$page==null||!is_numeric($page)) $page=1; if($page>$totalPage) $page=$totalPage; $sql2="select albumPath from jiahe_album where rid='{$id}' limit {$offset},{$pageSize}"; $result2=mysql_query($sql2); while($row1=mysql_fetch_array($result2)){ $rows[]=$row1; }
图片的albumPath已经存放在$rows中了,怎么分页显示它们啊