From 3b10833ea757709130b0fa295bb9fc0b13cda48f Mon Sep 17 00:00:00 2001 From: CuzImBisonratte Date: Wed, 29 Nov 2023 10:47:45 +0100 Subject: [PATCH] Update index.php --- subjects/grades/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/grades/index.php b/subjects/grades/index.php index 24bf60c..ca02d47 100644 --- a/subjects/grades/index.php +++ b/subjects/grades/index.php @@ -133,7 +133,7 @@ $average = $grade_sum / $weight_sum; // Insert average into subject if ($stmt = $con->prepare('UPDATE subjects SET average = ? WHERE id = ?')) { - $stmt->bind_param('si', $average, $subject_id); + $stmt->bind_param('ss', $average, $subject_id); $stmt->execute(); $stmt->close(); } else { @@ -143,7 +143,7 @@ // If no grades but average is given -> delete average if ($num_of_k + $num_of_m + $num_of_t + $num_of_s == 0) { if ($stmt = $con->prepare('UPDATE subjects SET average = 0 WHERE id = ?')) { - $stmt->bind_param('i', $subject_id); + $stmt->bind_param('s', $subject_id); $stmt->execute(); $stmt->close(); } else {