I’ve noticed a very interesting difference between my local development environment and my actual webhosting. In the master post this is the query that displays the artists available (if they have downloads). On my local development environment all the artists keep coming up, while on my webhosting only those with downloads show up (as they should). If I change LEFT JOIN to RIGHT JOIN I reverse the problem. lol.
|
1 2 3 4 5 |
SELECT ar_artist_id, ar_artist, ar_image, COUNT(vi_artist_id) AS ar_numvideo
FROM (artist INNER JOIN videos ON artist.ar_artist_id = videos.vi_artist_id) LEFT JOIN videodownloads ON videos.vi_video_id = videodownloads.vd_video_id
WHERE artist.ar_pubterm <> 'Actor' OR 'Actress'
GROUP by ar_artist_id
ORDER BY ar_artist |
It’s the same with this query that shows the downloads per artist on the artist page.
|
1 2 3 4 |
SELECT artist.ar_artist_id, videotypes.vt_videotype, videotypes.vt_videotype_id
FROM artist INNER JOIN (videotypes INNER JOIN videos ON videotypes.vt_videotype_id = videos.vi_videotype_id) ON artist.ar_artist_id = videos.vi_artist_id LEFT JOIN videodownloads ON videos.vi_video_id = videodownloads.vd_video_id
GROUP BY artist.ar_artist_id, videotypes.vt_videotype, videotypes.vt_videotype_id
HAVING (((artist.ar_artist_id)=$artistId)) |
What the hell? I have no explanation. haha.