Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from noten-app/Hotfix-hardcoded-value
Browse files Browse the repository at this point in the history
Update index.php
  • Loading branch information
CuzImBisonratte authored Nov 29, 2023
2 parents 0d19f18 + 3b10833 commit 0b97cf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subjects/grades/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
$average = $weight_otherum / $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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 0b97cf2

Please sign in to comment.