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 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? Link to comment https://forums.phpfreaks.com/topic/185206-bayesian-rating-system-problem/#findComment-977941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.