Thank you for looking at this problem, details are all below.
Below is the code
<form style="overflow: hidden;" method="post">
<input type="checkbox" aria-label="Checkbox for following text input"
name="kursus[]" value="<?php echo $row['IDKursus']; ?>">
<div class="d-flex justify-content-between mt-3">
<button type="submit" class="btn btn-success" name="daftar_kursus">Daftar Kursus</button>
<button type="reset" class="btn btn-primary">Reset</button>
</div>
</form>
if (isset($_REQUEST['daftar_kursus'])) {
$IDKursus = implode(',', $_POST['kursus']);
try {
//Kursus
$user = $_SESSION['pensyarah_login'];
$query = "UPDATE pensyarah SET IDKursus = '$IDKursus' WHERE IDUser = '$user';";
$sth = $db->prepare($query);
$sth->execute();
echo "nice";
} catch (PDOException $e) {
$e->getMessage();
}
}
Screenshot Table Pensyarah
Screenshot Table Kursus
I hope to solve this problem soon. Thank you