I have a form for updating data including name , email and age I click the update user button and i will get the error please fill in the required fields.
I have tried writing the sql statement may ways including checking the table name.
{
<?php
$sql = "UPDATE u_data SET Email = '$Email' , Name = ''$Name' , Age = '$Age' WHERE Id = '$Id'";
if(mysqli_query($conn , $sql))
{
if(!empty($Email) || !empty($Name) || !empty($Age))
{
$Success = "User has been Updated Successfully!";
header("Location: Updating_U.php?Success=" . urlencode($Success));
exit();
}
}
?>
}
When i fill out all form fields a message is supposed to say User has been Updated Successfully!. But instead i always get an error saying please fill in the required fields. I have no idea why the database row won't update with new data.