I'm doing a SELECT query to my database, but I do not get what I want I've been reading the framework documentation, but I have not found the answer. This is what I have:
public function getUpdate(){
1-$id = $_GET['id'];
2-var_dump($id);
3-$user = Users::query()->where('id', '=', $id)->get();
4-var_dump($user);
5-return $this->render('admin/update.twig', [
'user' => $user
]);
}
In line 3 I am doing the query, but all the users of the database are returning me and I only need the user with the id that I asked for. I need help with that.