<?php
require_once('dbconnection.php');

$old_number = $_POST['old_number'];
$name       = $_POST['name'];
$number     = $_POST['number'];

$sql = "UPDATE Contact SET name='$name', from_number='$number' WHERE from_number='$old_number'";

if (mysqli_query($con, $sql)) {
    echo "Contact updated successfully!";
} else {
    echo "Error updating record: " . mysqli_error($con);
}

mysqli_close($con);
?>
