Php 从数组分页
我一直在尝试把我的照片分页,但是非常非常不成功。我希望我能得到一些关于如何做的提示。这是我的密码Php 从数组分页,php,Php,我一直在尝试把我的照片分页,但是非常非常不成功。我希望我能得到一些关于如何做的提示。这是我的密码 <?php $result = mysql_query("SELECT * FROM images ORDER BY position"); while ($image = mysql_fetch_array($result)){ ?> <img src="images/uploads
<?php
$result = mysql_query("SELECT * FROM images ORDER BY position");
while ($image = mysql_fetch_array($result)){
?>
<img src="images/uploads/thumbs/<?php echo $image['thumb'];?>" width="100%" height="100%" alt="" class="thumbnail" />
<input type='button' value='Preview' onclick="changedesc(<?php echo $image['image_id']; ?>); return false;" />
<?php }?>
“width=“100%”height=“100%”alt=“class=”缩略图”/>
这个应该可以
<?php
$query = "SELECT * FROM images ORDER BY date";
$result = mysql_query($query);
while ($image = mysql_fetch_assoc($result)){
echo '
<img src="images/uploads/thumbs/'.$image['thumb'].'" width="100%" height="100%" alt="" class="thumbnail" />
';
}
?>