/home/techb158/workloadmatch.com/workloadmatch.com/Manager/Inc
Edit: /home/techb158/workloadmatch.com/workloadmatch.com/Manager/Inc/Update_Course.php (2019B)
query($querys);
$rows = $results->fetch_assoc();
$Admin_ID = $rows['Admin_ID'];
$Master_ID = $rows['Master_ID'];
$Manager_ID = $rows['Manager_ID'];
$Manager_ID_Profile = $rows['Manager_ID'];
$datetime =date("Y/m/d") . ' ' . date('H:i:s') ;
//header('Location: addgroup.php?error='.$mysqli->error);
//header('Location: addgroup.php?error='.$Link_ID.'');
//exit();
$prep_stmt = "SELECT Course_ID FROM Courses WHERE Course_ID = ? LIMIT 1";
$stmt = $mysqli->prepare($prep_stmt);
if ($stmt) {
// echo $_POST['G_ID'];
$stmt->bind_param('s', $Course_ID);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows == 1) {
// A user with this email address already exists
//$error_msg .= '
A user with this user name already exists.
';
if (!$mysqli->query("UPDATE Courses SET Course_Name='".$Course_Name."', Course_Code='".$Course_Code."', Course_Time='".$Course_Time."' WHERE Course_ID='".$Course_ID."'")) {
//header('Location: addcourse.php?error=Course update failure!');
echo $mysqli->error;
exit();
}else{
header('Location: addcourse.php?error=Course update successfully. Thanks!');
exit();
}
}
} else {
//$error_msg .= '
Database error
';
}
}else{
header('Location: addcourse.php?error=all information are required!');
exit();
}
}