-
Notifications
You must be signed in to change notification settings - Fork 0
/
editp.php
29 lines (23 loc) · 911 Bytes
/
editp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
//untuk koneksi ke database
session_start();
include ("koneksi.php");
//proses edit
$id_poin = $_POST['id_poin'];
$poin = $_POST['poin'];
$sub = $_POST['sub'];
// $ubah = mysqli_query("UPDATE tab_poin SET poin ='".$poin."', poin ='".$poin."' WHERE id_poin='".$id_poin."' ");
// echo "<script>alert('Ubah Data Dengan ID = ".$id_poin." Berhasil') </script>";
// echo "<script>window.location.href = \"poin.php\" </script>";
$query = "UPDATE tab_poin SET poin='$poin',sub='$sub' WHERE id_poin='$id_poin' ";
$result = mysqli_query($koneksi,$query);
if ($result) {
// code...
echo "<script>alert('Ubah Data Dengan ID = ".$id_poin." Berhasil') </script>";
echo "<script>window.location.href = \"poin.php\" </script>";
}else {
// code...
echo "<script>alert('Ubah Data Dengan ID = ".$id_poin." gagal ') </script>";
echo "<script>window.location.href = \"poin.php\" </script>";
}
?>