Can some kind person help me with this one please
The problem I've got is it seems to be ignoring the ORDER BY element.
At the moment we have 6 galleries and 4 groups. In a gallery id/group id structure the fd_gallery goes like this:
gallery_id/group_id
1/1
2/2
3/3
4/4
5/2
6/4
It's working fine in terms of the GROUP BY as it's only showing 4 galleries, but it's not showing the latest versions of the groups which it would do if it took notice of the ORDER BY. So it's showing gallery_id 4 instead of 6 and 2 instead of 5.
HELP!
Code:
"SELECT fd_gallery.gallery_id, fd_gallery.gallery_title, fd_gallery_images.image_thumb " .
"FROM fd_gallery " .
"INNER JOIN fd_gallery_images ON fd_gallery.gallery_id=fd_gallery_images.gallery_id " .
"WHERE fd_gallery_images.image_active='1' ".
"GROUP BY fd_gallery.group_id " .
"ORDER BY fd_gallery.gallery_id DESC";
The problem I've got is it seems to be ignoring the ORDER BY element.
At the moment we have 6 galleries and 4 groups. In a gallery id/group id structure the fd_gallery goes like this:
gallery_id/group_id
1/1
2/2
3/3
4/4
5/2
6/4
It's working fine in terms of the GROUP BY as it's only showing 4 galleries, but it's not showing the latest versions of the groups which it would do if it took notice of the ORDER BY. So it's showing gallery_id 4 instead of 6 and 2 instead of 5.
HELP!