mnaufaldillah

proses edit tugas php

Dec 6th, 2021
611
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include('config.php');
  3.  
  4.     $id = $_POST['id'];
  5.     $nama = $_POST['nama'];
  6.     $alamat = $_POST['alamat'];
  7.     $jenis_kelamin = $_POST['jenis_kelamin'];
  8.     $agama = $_POST['agama'];
  9.     $sekolah_asal = $_POST['sekolah_asal'];
  10.  
  11.     $sql = "UPDATE calon_siswa SET
  12.     nama = '".$nama."',
  13.     alamat = '".$alamat."',
  14.     jenis_kelamin = '".$jenis_kelamin."',
  15.     agama = '".$agama."',
  16.     sekolah_asal = '".$sekolah_asal."'
  17.     WHERE id = ".$id;
  18.  
  19.     $query = mysqli_query($db_connection, $sql);
  20.  
  21.     if ($query) {
  22.         header('Location: list-siswa.php?status=sukses');
  23.     }else {
  24.         header('Location: list-siswa.php?status=gagal');
  25.     }
  26. ?>
RAW Paste Data