edit

parent fce8f776
......@@ -4,7 +4,7 @@ include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$query = "SELECT menu.harga as harga, pesanan.jumlah as jumlah FROM pesanan INNER JOIN menu ON pesanan.id_menu = menu.id";
$result_set = $database->query($query);
$result_set = $conn->query($query);
?>
?>
<!DOCTYPE html>
......
......@@ -13,7 +13,7 @@ $harga = $_GET['harga'];
$id = get_session('id');
$query = 'INSERT INTO pembayaran( `id_user`, `total`) VALUES(?, ?)';
$statement = $database->prepare($query);
$statement = $conn->prepare($query);
$statement->bind_param('is', $id, $harga);
$statement->execute();
redirect('index.php#pembayaran');
......
......@@ -28,10 +28,10 @@ $gambar = basename($_FILES['uploaded_file']['name']);
$sql = "UPDATE menu SET nama='$nama', harga='$harga', deskripsi='$deskripsi', id_karyawan=$id_karyawan, gambar='$gambar' WHERE id=$id";
if ($database->query($sql) === TRUE) {
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $database->error;
echo "Error updating record: " . $conn->error;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment