Browse code

reviews.php: Number of Likes - let one slip by...

Clarissa Walker authored on 2026/09/12 16:04:53
Showing 1 changed files
... ...
@@ -161,7 +161,7 @@ else if($action == "edit" || $action == "add") {
161 161
 				if($totalcount) $update = dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET rating = '".round($totalcount)."' WHERE sid = '$item'");
162 162
 				unset($totalcount);
163 163
 				if($ratings == 3) {
164
-					$count2 = dbquery("SELECT AVG(rating) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews WHERE chapid = '$chapid' AND rating != '-1'");
164
+					$count2 = dbquery("SELECT COUNT(rating) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews WHERE chapid = '$chapid' AND rating != '-1'");
165 165
 				} else {
166 166
 					$count2 = dbquery("SELECT AVG(rating) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews WHERE chapid = '$chapid' AND rating != '-1'");
167 167
 				}