I have the following:
public function getAll($limit = 100)
{
//if ($thread != 0) { $threadq = "WHERE threadId=$threadId"; }
$query = <<<EOF
SELECT
x.*
FROM x
ORDER BY dater DESC
LIMIT ?
EOF;
return self::$db->fetchAll($query, $limit);
}
It seems it turns the LIMIT x
into LIMIT 'x'
and so the MySQL query parser goes wrong and complains.
However doing LIMIT $limit
works fine
Why does this not work? and is there another method of doing this?