Created
August 17, 2015 16:26
-
-
Save AriffAzmi/60016f1ceb3147a381b2 to your computer and use it in GitHub Desktop.
Update php code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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