1

hello guys I have a problem editing the file, I added previously the update option but the problem begins when I click the "edit option" and I get a error result

<br /><b>Notice</b>:  Undefined variable: UserName in 
<b>C:\xampp\htdocs\CRUD\edit.php</b> on line <b>33</b><br />

I looked up into the line and according with, I checked the connection ans have not problem with that but is still showing the same error.

there is my connection

 <?php
require_once("conection.php");
$UserID = $_GET['GetID'];
$query = "select * from user where User_ID='".$UserID."'";
$result = mysqli_query($con,$query);

while ($row = mysqli_fetch_assoc($result)) 
{
    $UserID = $row['User_ID'];
    $UserName = $row['User_Name'];
    $UserAge = $row['User_Age'];
    $UserEmail = $row['User_Email'];
}

?>

there is the line code that is giving me error

<form action="update.php" method="post">
                    <input type="text" class="form-control mb-2" 
placeholder=" User Name " name="name" value="<?php echo $UserName ?>">
                    <input type="text" class="form-control mb-2" 
placeholder=" User Age " name="age"value="<?php echo $UserAge ?>">
                    <input type="email" class="form-control mb-2" 
placeholder=" User Email " name="email"value="<?php echo $UserEmail ?>">
                    <button class="btn btn-primary" 
name="actualizar">Actualizar</button>
                    </form>

I'm missing something ?

0 Answers0