Issue in update data using php

in my case I am working on CRUD Project in php. now i have problem in edit query when I select database and get id which data ia want to edit and try to get that data at that time its shaw an error of undefine value

This is my php code

if(isset($_GET['id']))
        $eid=$_GET['id'];
        
$query = "SELECT *FROM `form_data` WHERE id=$eid";
$exQuery=mysqli_query($conn,$query);

$fname=$row['firstname'];
echo $fname;

it’s shaw an error