-
Notifications
You must be signed in to change notification settings - Fork 0
/
roomUpdateStore.php
44 lines (35 loc) · 981 Bytes
/
roomUpdateStore.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "dbphp";
$con = mysqli_connect($host,$dbusername,$dbpassword,$dbname);
if (mysqli_connect_error()) {
die('connect Error('.mysqli_connect_error().')'.mysqli_connect_error());
}
if (isset($_POST['OK'])){
$id=$_POST['id'];
$block=$_POST['block'];
$room=$_POST['room'];
$rw=$_POST['row'];
// $INSERT="INSERT INTO room(block,roomno,row) values('$block','$room','$row')";
$sql="UPDATE `room` SET block='$block',roomno='$room',row='$rw' WHERE id=$id ";
$result=mysqli_query($con,$sql);
if($result){
?>
<script>
alert('Successfully Room Update Save');
window.open('operationRoom.php','_self');
</script>
<?php
}else{
?>
<script>
alert('Error--!!');
window.open('operationRoom.php','_self');
</script>
<?php
}
}
mysqli_close($con);
?>