I have this url which sends the parameter id by means of the get method, but when I want to receive it through the controller, it tells me that it does not exist.
public function getUpdate(){
global $pdo;
$id = $_GET['id'];
$sql = "SELECT * FROM users WHERE id=:id";
$query = $pdo->prepare($sql);
$query->execute([
'id' => $id
]);
$row = $query->fetch(\PDO::FETCH_ASSOC);
$nameValue = $row['name'];
$emailValue = $row['email'];
return render('../views/admin/update.php', ['nameValue'=>$nameValue, 'emailValue'=>$emailValue]);
}
Then I put on this
Notice: Undefined index: id in /opt/lampp/htdocs/curso-php/databases/app/control/admin/usersControl.php online 21