Error in SQL Syntax
Boy this one has me whupped!
I'm grouping by NJcatSUBTITLE because I only want one of each sub-title to be displayed. It's the accompanying image that I want randomised as there is more than one image in each sub-category.
When I run this in PHP MyAdmin:
SELECT NJlinkcatsubgal.NJcatSUBID, NJcategoriesSUB.NJcatSUBTITLE, NJgallery.NJgalleryID, NJgallery.NJdomainID, NJgallery.NJgalleryIMG, NJgallery.NJgalleryTITLE
FROM NJlinkcatsubgal
INNER JOIN NJcategoriesSUB ON NJlinkcatsubgal.NJcatSUBID = NJcategoriesSUB.NJcatSUBID
INNER JOIN NJgallery ON NJlinkcatsubgal.NJgalleryID = NJgallery.NJgalleryID
WHERE NJgallery.NJgalleryDELETE = 2
GROUP BY NJcategoriesSUB.NJcatSUBTITLE
ORDER BY RAND()
...it returns 75 records.
It's doing everything but randomising the image.
NJ