WordPress-Datenbank-Fehler: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1' at line 43]
SELECT distinct(mo.id_media_objects) as id_media_object,mo.id_object_type,
mo.name,
mo.code,
mo.tags,
(
SELECT
`data`
FROM
`wp_pm_media_objects`
WHERE
`id_media_objects` = mo.`id_media_objects`
LIMIT
1
) as data,
mo.id_pool,
mo.visibility,
mo.valid_from,
mo.valid_to,
mo.url,
mo.min_price as sortprice,
mo.next_departure as sortdate, tbpT.`duration` FROM wp_pm_search mo left join wp_pm_touristic_dates td on (mo.id_media_objects = td.id_media_object) left join wp_pm_touristic_booking_packages tbpT on (mo.id_media_objects = tbpT.id_media_object) WHERE 1=1/* order by rating */ AND
(
NOW() >= valid_from AND
NOW() <= valid_to OR
valid_from = '0000-00-00 00:00:00' AND
valid_to = '0000-00-00 00:00:00' OR
valid_from = '1970-01-01 00:00:00' AND
valid_to = '1970-01-01 00:00:00'
)
/*page_vars_where*/ and mo.visibility = 30 and mo.id_pool = 1857 and mo.id_object_type in(1524,1525,1526,1530) and mo.id_object_type != 1525/*query_vars_where*/ and (
(
SELECT
COUNT(DISTINCT(id_item))
FROM
`wp_pm_media_object_tree_items`
WHERE
id_media_object = mo.id_media_objects AND
id_tree = 2746 AND
id_item IN("bab70be108d5526061cbb467204f4e9c")
) > 0
)
/*query_vars_where / touristic */ and tbpT.`duration` >= 1 order by tbpT.duration asc limit -1,1