I'm making a SELECT query to my database, but I can't get what I want. I've been reading the framework's documentation, but I haven't 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 making the query, but it is returning all the users of the database and I only need the user with the id that I requested. i need help with that.
If you are working on laravel, just do this