如何从数据库中调用`id`?

i have created a form to update name into database, i have created two tables first_name and last_name into database, have look once here is my code:

$sql="
CREATE TABLE admin
(
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(100),
last_name VARCHAR(100),
)";

Now i have created to update form here:

<div class="box">
    <h1 style="font-family: consolas">Change your name</h1><hr>
    <div id="change_name">
        <label><strong>Your current name: </strong></label>
        <?php
        include('change_setting_db.php');

        while($row = mysqli_fetch_array($result))
        {
            echo $row['first_name']." ".$row['last_name'];
        }
        ?><br><br>

        <form method="post" action="do_update_name.php">
        <label><strong>First name: </strong></label>
        <input type="text" name="first_name">
        <label><strong>Last name: </strong></label>
        <input type="text" name="last_name">
            <input type="submit" value="Submit">
        </form>

    </div>

</div>

and here is my do_update_name.php file:

<?php
$firstname=$_POST['first_name'];
$lastname=$_POST['last_name'];
$id=$_GET['id'];

$con=mysqli_connect("localhost","root","Bhawanku", "members");
// Check connection
if (mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$update =mysqli_query($con,"UPDATE admin SET first_name='$firstname' AND  last_name='$lastname' WHERE id='$id' ");
if($update){
    echo "Successfully created!!";
}
?>

Now problem is when i put new name and do submit, it shows an error:

Notice: Undefined index: id in C:\Users\Raj\PhpstormProjects\...
ew do_update_name.php on line 4
Successfully created!!
<form method="post" action="do_update_name.php">
        <label><strong>First name: </strong></label>
        <input type="text" name="first_name">
        <label><strong>Last name: </strong></label>
        <input type="text" name="last_name">
            <input type="submit" value="Submit">
        </form>

You have to add the ID here, so the other side can pick up the $_GET parameter ['id'] For example:

<form method="post" action="do_update_name.php?id=1">
        <label><strong>First name: </strong></label>
        <input type="text" name="first_name">
        <label><strong>Last name: </strong></label>
        <input type="text" name="last_name">
            <input type="submit" value="Submit">
        </form>

HTML form with id in input type hidden

<div class="box">
    <h1 style="font-family: consolas">Change your name</h1><hr>
    <div id="change_name">
        <label><strong>Your current name: </strong></label>
        <?php
        include('change_setting_db.php');

        while($row = mysqli_fetch_array($result))
        {
            $id = $row['id'];
            $first_name = $row['first_name'];
            $last_name = $row['last_name'];
            echo $id.") ".$first_name." ".$last_name;
        }
        ?>
        <br>
        <br>
        <form method="post" action="do_update_name.php">
        <input type="hidden" name="id" value="<?php echo $id;?>">
        <label><strong>First name: </strong></label>
        <input type="text" name="first_name" value="<?php echo $first_name;?>">
        <label><strong>Last name: </strong></label>
        <input type="text" name="last_name" value="<?php echo $last_name;?>">
        <input type="submit" value="Submit">
        </form>

    </div>
</div>

PHP code with $_POST['id']

<?php
$firstname=$_POST['first_name'];
$lastname=$_POST['last_name'];
$id=$_POST['id'];

…
?>