fix sql syntax

This commit is contained in:
Matthew Exon 2022-03-03 07:37:37 +01:00
parent 5e7311a588
commit 8b4e9c0e5d

View file

@ -172,8 +172,7 @@ function retriever_retrieve_items($max_items) {
*/
function retriever_clean_up_completed_resources($max_items) {
// TODO: figure out how to do this with DBA module
$r = DBA::p('SELECT retriever_resource.`id` as resource, retriever_item.`id` as item FROM retriever_resource, retriever_item, retriever_rule WHERE retriever_item.`finished` = 0 AND retriever_item.`resource` = retriever_resource.`id` AND retriever_resource.`completed` IS NOT NULL AND retriever_item.`contact-id` = retriever_rule.`contact-id` AND retriever_item.`item-uid` = retriever_rule.`uid` LIMIT %d',
intval($max_items));
$r = DBA::p("SELECT retriever_resource.`id` as resource, retriever_item.`id` as item FROM retriever_resource, retriever_item, retriever_rule WHERE retriever_item.`finished` = 0 AND retriever_item.`resource` = retriever_resource.`id` AND retriever_resource.`completed` IS NOT NULL AND retriever_item.`contact-id` = retriever_rule.`contact-id` AND retriever_item.`item-uid` = retriever_rule.`uid` LIMIT $max_items");
if (!DBA::isResult($r)) {
return;
}