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 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 = 1796 and mo.id_object_type in(1439,1507,1438,1442,1440) and mo.id_object_type not in(1439,1507,1442) /*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 = 2635 AND
id_item IN("k3979D854-CEE8-3B7B-977D-08EC6404DA03")
) > 0
)
/*query_vars_where / touristic */ and tbpT.`duration` >= 1 order by tbpT.duration asc limit -1,1