I'm trying add limit & offset as variables on a sql in php application
code looks like this:
$bind[':limit'] = $limit;
$bind[':offset'] = $offset;
$sql= 'SELECT id, monkeys '.
'from monkeyisland mi ' .
'left join monkeyland ml '
'on mi.id = ml.id ' .
'LIMIT :limit OFFSET :offset ';
$result = $query->run($sql,$bind);
the error message saying:
syntax error check Mariadb server version for the right syntax to use near ''100' OFFSET '0''
is there a different way to right this query variables? Thanks for help in advance