i have this code
Code: Select all
$latestfile = mysql_query("SELECT DISTINCT cat_id FROM `ccms_screenshots` GROUP BY id ORDER BY `id` DESC limit 4");
$mydata = array(); //create the data holder
while($row = mysql_fetch_assoc($latestfile)){....Okay this will allow me to show distinct cat_id's in descending order. But how do i display other columns from the database?
If i try this
Code: Select all
$latestfile = mysql_query("SELECT DISTINCT cat_id,title,url,date FROM `ccms_screenshots` GROUP BY id ORDER BY `id` DESC limit 4");Then the distinct query will stop working and doesnt show cat_id distinct.
The first one i posted at the top of this post is working fine, but will not allow me to show other info from the rows. how would i extract the other data like url and title etc?




