Advertisement
Guest User

process-add

a guest
Jul 24th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2.  
  3.     // $id_customer_complain    = $_POST['id_customer_complain'];
  4.     $id_customer        = $_POST['id_customer'];
  5.     $datetime_complain  = $_POST['datetime_complain'];
  6.     $datetime_solved    = $_POST['datetime_solved'];
  7.     $complain_via       = $_POST['complain_via'];
  8.     $id_engineer        = $_POST['id_engineer'];
  9.     $permasalahan       = $_POST['permasalahan'];
  10.     $swos               = $_POST['swos'];
  11.     $status             = $_POST['status'];
  12.  
  13. // KONEKSI KE DATABASE
  14. $con = mysql_connect("localhost", "root", "");
  15. mysql_select_db('noc_coba');
  16. // SQL
  17. $sql = "insert into user values('', '$id_customer', '$datetime_complain', '$datetime_solved',
  18.                                 '$complain_via','$id_engineer','$permasalahan','$swos','$status')";
  19. // EKSEKUSI
  20. $hasil = mysql_query($sql);
  21.  
  22. if ($hasil){
  23. echo "Simpan Berhasil";
  24. }
  25. else {
  26. echo "Gagal Simpan $id_engineer </br>";
  27. }
  28.  
  29. include "index.php";
  30. ?>
  31. <?php
  32. $host = "localhost";
  33. $user = "root";
  34. $pass = "";
  35.  
  36. $con=mysql_connect($host,$user,$pass)
  37.                 or die("Tidak dapat connect ke server");
  38.     mysql_select_db("noc_coba")
  39.                 or die ("Database tidak ada");
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement