我只是想问一下,如何获得photoNumber的MOST最高值,而我的album_name有2个(TWO)字段,我无法检索photo_number的最高值,因为如果用户上传了一张新图片photo_number是自动递增的,但当我使用ORDER BY获取该专辑的最新数量时,它不起作用......
function perAlbum($accID) {
$result = mysql_query("SELECT * FROM photos WHERE accountID = '{$accID}' GROUP BY album_name ORDER BY photo_number DESC");
if(mysql_num_rows($result) != 0) {
while( $row = mysql_fetch_array($result) ) {
echo "<div class=\"myPhotos\"><img title='Album: {$row['album_name']}' src=\"images/profile/".$row['photo_link']."\"/></div>";
}
}else{
echo "No Album Created";
}
}