I'm having a problem with a query:
$sth = $Db->dbh->prepare(
"SELECT *
FROM loader
WHERE download = 0
AND lastconnected BETWEEN DATE_SUB(NOW(),INTERVAL 15 MINUTE) AND NOW()
ORDER BY lastconnected DESC
LIMIT :amount");
The LIMIT isn't working for some reason, if I change :amount to a hardcoded number it'll work but as soon as I use it as :amount it's giving me this error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''1'' at line 5
This is what I'm using to execute the prepared query:
$sth->execute(array(':amount' => $amount));
Been trying to figure it out for a couple of hours now. Hopefully someone can see something I'm not.