tommyda Posted December 15, 2009 Share Posted December 15, 2009 Here is my query. <?php $query = mysql_query(" SELECT typeid, (select count(typeid) from ratings) / (select count(distinct typeid) FROM ratings) AS avg_num_votes, (select avg(rating) from ratings) AS avg_rating, count(typeid) as this_num_votes, avg(rating) as this_rating FROM ratings GROUP BY typeid ")or die(mysql_error()); ?> Im getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select typeid, ((avg_num_votes * avg_rating) + (this_num_votes * this_rating) / ' at line 10 Quote Link to comment https://forums.phpfreaks.com/topic/185206-bayesian-rating-system-problem/ Share on other sites More sharing options...
fenway Posted December 15, 2009 Share Posted December 15, 2009 What version? Quote Link to comment https://forums.phpfreaks.com/topic/185206-bayesian-rating-system-problem/#findComment-977941 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.