我的index.php文件:有序列表重複號1個
<?php
$query = mysql_query("SELECT `pic_id` FROM image_tag ORDER BY `pic_id`");
while($run = mysql_fetch_array($query)){
$pic_id = $run['pic_id'];
$left = $run['left'];
$top = $run['top'];
?>
<div id = "taggednum" style = "top:<?php echo $top; ?>; left:<?php echo $left; ?>;">
<ol><li rel ="<?php echo $pic_id; ?>"></li></ol>
</div>
<?php
}
?>
它不會顯示在列表中正確的號碼。它爲整個列表編號爲'1'。這裏有什麼問題?
請修復您的sql語法:SELECT'pic_id','top','left' FROM image_tag ORDER BY'pic_id'「。 – andrew
當你在這裏時,請注意'mysql *'庫使用是[棄用](http://www.php.net/manual/en/function.mysql-query.php) – Nanne