MySQLi Update Record

MySQLi UPDATE statement is used to update existing records in a table.

Below the syntax of UPDATE command.

UPDATE table_name SET field1 = value1, field2 = value2 [WHERE Clause]
<?php
$conn  = mysqli_connect('localhost:3306', 'user_name', 'password', 'db_nexladder');
 if(! $conn) {
     die('Could not connect: ' . mysqli_error());
 }
 $sql = "UPDATE `tbl_customers` SET `first_name` = 'Vijay' WHERE `id` = 1";
 if (mysqli_query($conn, $sql)) {
    echo "Updated Successfully";
 } else {
    echo "Error: " . mysqli_error($conn);
 }
 mysqli_close($conn);
?>

Below it'll look like

mysql update