how to make mysql update function in php code example
Example 1: mysql update query
UPDATE table_name SET field1 = 'value 1', field2 = 'value 2'
WHERE field3 = 'value 3'
Example 2: mysqli procedural UPDATE
if ($db->query("UPDATE contact SET lastname='Doe' WHERE id=2") === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record";
}