-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate.php
More file actions
35 lines (30 loc) · 1.13 KB
/
update.php
File metadata and controls
35 lines (30 loc) · 1.13 KB
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
<?php
// Insert the content of connection.php file
include('connection.php');
// Update data into the database
if(ISSET($_POST['updateData']))
{
$id = $_POST['updateId'];
$firstname = $_POST['updateFirstname'];
$lastname = $_POST['updateLastname'];
$address = $_POST['updateAddress'];
$skills = $_POST['updateSkills'];
$designation = $_POST['updateDesignation'];
$sql = "UPDATE tbl_record SET firstname='$firstname',
lastname='$lastname',
address='$address',
skills=' $skills',
designation = '$designation'
WHERE id='$id'";
$result = mysqli_query($conn, $sql);
if($result)
{
echo '<script> alert("Data Updated Successfully."); </script>';
header("Location:index.php");
}
else
{
echo '<script> alert("Data Not Updated"); </script>';
}
}
?>