Im trying to update record in database but when I submit the changes it creates a new record instead… code is below.
<?php
session_start();
error_reporting(0);
include('include/dbconnection.php');
if (strlen($_SESSION['pdaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$fullname=$_POST['fullname'];
$profession=$_POST['profession'];
$email=$_POST['email'];
$mobilenumber=$_POST['mobilenumber'];
$address=$_POST['address'];
$account_n=$_POST['account_n'];
$sort=$_POST['sort'];
$rent=$_POST['rent'];
$bonus=$_POST['bonus'];
$notes=$_POST['notes'];
$bywho=$_POST['bywho'];
$city=$_POST['city'];
$admsta=1;
$query=mysqli_query($con, "insert into tbldirectory (FullName,Profession,Email,MobileNumber,Address,account_n,sort,rent,bonus,notes,bywho,City,Status) value('$fullname','$profession','$email','$mobilenumber','$address','$account_n','$sort','$rent','$bonus','$notes','$bywho','$city','$admsta')");
if ($query) {
$msg="Client Details Updated Successfully";
}
else
{
$msg="Something Went Wrong. Please try again";
}
}
?>