-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
29 lines (28 loc) · 1014 Bytes
/
update.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
<!DOCTYPE html>
<html>
<body>
<?php
$item_id = $_POST['item_id'];
$item_name = $_POST['item_name'];
$category = $_POST['category'];
$brand = $_POST['brand'];
//$image = $_POST['item_image];
$quantity = $_POST['quantity'];
$item_weight = $_POST['item_weight'];
$conn=mysqli_connect('localhost','root','','donationsystem');
if($conn){
//echo "Connection successfull";
$stmt = $conn->prepare("update items set item_name=?,category=?,brand=?,quantity=?,item_weight=? where item_id=?");
$stmt->bind_param("sssiii",$item_name,$category,$brand,$quantity,$item_weight,$item_id);
$stmt->execute();
echo "<script>alert('Item Updated successfully')</script>";
echo "<script>window.location='./#items-display'</script>";
$stmt->close();
mysqli_close($conn);
}
else{
echo "Connection Failed!";
}
?>
</body>
</html>