Guest User

CRUD Mysqli update.php

a guest
May 25th, 2018
4,974
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2. include"koneksi.php";
  3.  
  4.  
  5.  
  6. $id = $_POST['id_mahasiswa'];
  7. $nama = $_POST['nama'];
  8. $jenis_kelamin = $_POST['jenis_kelamin'];
  9. $alamat = $_POST['alamat'];
  10. $telepon = $_POST['telepon'];
  11.  
  12. $query = "UPDATE mahasiswa SET
  13.                                 nama = '$nama',
  14.                                 jenis_kelamin = '$jenis_kelamin',
  15.                                 alamat = '$alamat',
  16.                                 telepon = '$telepon'
  17.                                 WHERE id_mahasiswa = '$id'
  18.                                 ";
  19.  
  20. mysqli_query($koneksi, $query)
  21. or die ("Gagal Perintah SQL".mysql_error());
  22. header('location:index.php');
  23.  
  24. ?>
Add Comment
Please, Sign In to add comment