-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
30 lines (24 loc) · 765 Bytes
/
Copy pathupdate.php
File metadata and controls
30 lines (24 loc) · 765 Bytes
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
<?php
include 'config.php';
$id = $_POST["id"];
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$address = $_POST["addr"];
$city = $_POST["city"];
$state = $_POST["state"];
$pin = $_POST["zip"];
$email = $_POST["email"];
$pwd = $_POST["pwd"];
$result = $mysqli->query("SELECT * FROM users WHERE id =".$id);
if($result) {
while($obj = $result->fetch_object()) {
$update = $mysqli->query("UPDATE users SET fname ='$fname', lname ='$lname' ,address='$address' ,city='$city' ,state='$state' ,pin='$pin' ,email='$email', password='$pwd' WHERE id =".$id);
if($update)
echo 'Data Updated';
else
echo 'Failed';
echo $mysqli->error;
}
}
header ("location:success.php");
?>