I want use LIMIT
with bindParam
so I build this query:
$app->get('/contact/get_contacts/{contact_number}', function (Request $request, Response $response, array $args)
{
$query = "SELECT * FROM contact LIMIT :contact_number";
$sql->bindParam("contact_number", intval($args["contact_number"]), PDO::PARAM_INT);
$sql->execute();
$result = $sql->fetchAll();
return $response->withJson($result);
});
I get this notice:
Only variables should be passed by reference
What I did wrong? I'm using Slim Framework
with PDO