Fix for updating comment values. See bug 335408.

git-svn-id: svn://10.0.0.236/trunk@201949 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mike.morgan%oregonstate.edu
2006-07-12 16:39:47 +00:00
parent 03bdfee88e
commit 727cf3c3cc

View File

@@ -95,6 +95,12 @@ if (isset($_POST['c_submit'])) {
$db->query($_sql);
if (!DB::isError($db->record)) {
// Calculate the lookup value in main for comment avg if our INSERT was successful.
$_ratingSql = "UPDATE `main` SET `Rating` = ROUND((SELECT AVG(`CommentVote`) FROM `feedback` WHERE `ID` = {$_c_id}),2) WHERE `ID` = {$_c_id}";
$db->query($_ratingSql);
}
// For the template
$added_comment = true;
}