mysql_select_db("grozavco_gallery", $con);
$result = mysql_query("SELECT * FROM Images");
while($row = mysql_fetch_array($result))
{
echo '<div class="thumb" id="' . $row['ID'] . '"><a class="ajax" href="gallery/' . $row['ID'] . '.html">';
echo '<p class="work-type">' . strtoupper ($row['Category']) . '</p>';
echo '<img src="http://grozav.com/images/thumbs/' . $row['ID'] . '-bwthumb.jpg" alt=""/>';
echo '<img src="http://grozav.com/images/thumbs/' . $row['ID'] . '-thumb.jpg" alt="" class="color"/>';
echo '</a></div>';
}
我希望它以相反的顺序显示。谁能告诉我怎么做?非常感谢!
答案 0 :(得分:3)
如何在查询中更改ORDER
呢?
mysql_query("SELECT * FROM Images ORDER BY ID DESC");
您还可以在打印前将所有数据存储到某个阵列,然后在其上执行array_reverse
。