php_fish Posted October 20, 2009 Share Posted October 20, 2009 I'm running version 4.1.7 MySQL on my local machine, my hosting company is running version 4.1.22. I get different results when I run the same query. Is this to be expected? Were there some changes released with version 4.1.7 that causes this? Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/ Share on other sites More sharing options...
Jonob Posted October 20, 2009 Share Posted October 20, 2009 Typically not. But we'd have to see the actual query. Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940275 Share on other sites More sharing options...
php_fish Posted October 20, 2009 Author Share Posted October 20, 2009 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; Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940279 Share on other sites More sharing options...
php_fish Posted October 20, 2009 Author Share Posted October 20, 2009 I should also point out that my local system is windows xp and the host run on Linux. Not sure if that should make any difference but that and version difference is all I can think of Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940477 Share on other sites More sharing options...
kickstart Posted October 20, 2009 Share Posted October 20, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940480 Share on other sites More sharing options...
php_fish Posted October 20, 2009 Author Share Posted October 20, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940655 Share on other sites More sharing options...
kickstart Posted October 20, 2009 Share Posted October 20, 2009 Hi Interesting. Can maybe imagine such a problem if the precedence changed, but that also seems unlikely. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/178322-solved-different-versions-different-results/#findComment-940662 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.