1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Fix SyntaxErrorException on select limit (#146)

SmsMapper:
* Fix SyntaxErrorException on select limit
* Remove unwanted LIMIT
This commit is contained in:
yneveu 2016-12-30 22:26:31 +01:00 committed by Ner'zhul
parent 71f5069537
commit 57de2f4e03

View File

@ -151,11 +151,9 @@ class SmsMapper extends Mapper {
public function getMessages ($userId, $start, $limit) {
$messageList = array();
$limit_i = (int) $limit;
$query = \OCP\DB::prepare('SELECT sms_address, sms_date, sms_msg, sms_type, sms_mailbox FROM ' .
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_date > ? ORDER BY sms_date LIMIT ?');
$result = $query->execute(array($userId, $start, $limit_i));
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_date > ? ORDER BY sms_date', (int) $limit);
$result = $query->execute(array($userId, $start));
while ($row = $result->fetchRow()) {
$messageList[$row["sms_date"]] = array(
"address" => $row["sms_address"],