Edit Directory

my code is below, i want to edit fields in mysql and not add as a new record. help please

if (strlen($_SESSION['pdaid']==0)) {
  } else{

    $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";
      $msg="Something Went Wrong. Please try again";


this didn’t really help me :frowning:

Since this is the same php code as in your previous thread (w only a different error_reporting value), why are you starting new threads for the same problem?

It is not the same problem I am wanting to know how to update a directory rather that create a new one.

*Same code, different problem *

You aren’t updating a directory, you are updating a record in the database. Simple update statement is all that is needed. I was posting how to do an upsert, which curtails issues if a record does not presently exist.

i am relatively new to all this, could you please show me how to update a record? every time i try to update a record, it just makes a duplicate with the changes made as a new record

Look up, sql update in mysql

Sponsor our Newsletter | Privacy Policy | Terms of Service