Jump to content

[SOLVED] Different versions, different results


php_fish

Recommended Posts

SELECT content.idcontent, content.title, content.main_body, media_files.file_name,media_files.media_type,media_assign.idmedia_assign,media_files.id_media_files

FROM (media_files LEFT JOIN media_assign  ON media_files.id_media_files = media_assign.id_media_files AND media_files.media_type = 0)

RIGHT JOIN

content

ON content.idcontent = media_assign.idcontent

GROUP BY content.idcontent

ORDER BY content.idcontent DESC;

Link to comment
Share on other sites

Hi

 

Nothing obvious, but you appear to be doing a RIGHT JOIN against a field that, due to the LEFT JOIN, might not be populated. The left join seems irrelevant.

 

All the best

 

Keith

 

I reversed the LEFT to a RIGHT join and it works fine on both platforms. Thanks for pointing me in the right direction. Still doesn't explain the different results earlier but hey I'm a happy chappy now :) woooooo weeeee

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.