Skip to content

Instantly share code, notes, and snippets.

@AriffAzmi
Created August 17, 2015 16:26
Show Gist options
  • Save AriffAzmi/60016f1ceb3147a381b2 to your computer and use it in GitHub Desktop.
Save AriffAzmi/60016f1ceb3147a381b2 to your computer and use it in GitHub Desktop.
Update php code
<?php
include 'config.php';
if (isset($_POST['update'])) {
$kelas_id = $_GET['id'];
$kelas_new = $_POST['n_classroom'];
$d_book_new = $_POST['n_classdate'];
$s_book_new = $_POST['new_start_time'];
$e_book_new = $_POST['new_end_time'];
$Q = "UPDATE book SET book_room = $kelas_new, d_book = $d_book_new, start_time = $s_book_new, end_time = $e_book_new WHERE id= '" . $kelas_id . "'";
$R = $mysqli->query($Q);
if ($R) {
header("Location: home.php");
}
else{
header("Location: error.php");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment