Answer the question
In order to leave comments, you need to log in
Whether it is possible to connect here limit through the Prepared expressions?
$sql = "select R.id,R.uri,R.pagetitle,R.content,
(select $TVR.value from $TVR where $TVR.tmplvarid=142 and $TVR.contentid=R.id limit 1) as poster
FROM $R AS R
JOIN $TVR ON R.id=$TVR.contentid
JOIN $MUC ON R.id=$MUC.contentid
WHERE published=1 and deleted=0 and template IN(97,108) and tmplvarid=170 and $TVR.value like ?
ORDER BY $MUC.createdon desc
LIMIT $sqlLimitStart,$itemsPage ";
$q = $modx->prepare($sql);
$q->execute(array($like));
$res = $q->fetchAll(PDO::FETCH_ASSOC);
Answer the question
In order to leave comments, you need to log in
Add named placeholders: LIMIT :offset, :limit, and then bind the parameter as a number:
But in this case, all parameters should be bound like this, and $stmt->execute() should be left empty.
php.net/manual/en/pdostatement.bindvalue.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question