Forum Moderators: coopster
$query = "SELECT MAX(id), postid, navn FROM gblondon065post WHERE kategori='info' GROUP BY postid";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo $row['navn'];
But it wont work. When i use echo $row['MAX(id)']; the highest id shows, but i want to echo the 'navn' and not the 'id'
Hope someone understands, im not that good in english :P
You should also add columns from your list into your GROUP BY clause. MySQL is one database that allows this as an extension to the standard but it is not good practice.
[dev.mysql.com...]