"SELECT r.picid, AVG(r.rate) AS average, p.filename, p.w, p.h, p.id, p.orginal, p.title FROM galleryrate AS r, gallerypictures AS p WHERE r.picid = p.id $galleryrated GROUP BY picid ORDER BY average DESC, p.id ASC"
Maar nu selecteert die elke foto waar 1 of meerdere stem op is, maar ik zou het willen maken dat er minstens 5 stemmen voor nodig zijn voor die weergegeven word in gallerij
SELECT r.picid, AVG(r.rate) AS average, p.filename, p.w, p.h, p.id, p.orginal, p.title FROM galleryrate AS r INNER JOIN gallerypictures AS p ON r.picid = p.id WHERE r.rate >= 5 GROUP BY picid ORDER BY average DESC, p.id ASC
SELECT r.picid, AVG(r.rate)AS average, p.filename, p.w, p.h, p.id, p.orginal, p.title FROM galleryrate AS r INNER JOIN gallerypictures AS p ON r.picid = p.id WHERE r.rate >=5 GROUP BY picid ORDER BY average DESC, p.id ASC