Advertisement
GWibisono

update

Jul 27th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require_once ("koneksi.php");
  3.  
  4. //mengambil nilai dari form
  5. $id_tamu=(int)$_POST['id_tamu'];
  6. if($id==0){
  7. die('<pre>'.print_r($_POST,1).print_r($_GET,1));
  8. }
  9. $nama = $_POST['nama'];
  10. //$alamat = $_POST['alamat'];
  11.  
  12. $update = mysql_query("UPDATE tes SET nama WHERE id_tamu = '$id_tamu'");
  13.  
  14. if ($update){
  15. //echo "sukses update data";
  16. ?><script>alert('sukses update data');
  17. document.location.href="tampil_tamu.html";
  18. </script><?php
  19. }else{
  20. echo "gagal : ".mysql_error();
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement