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 30]
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 = 1393 and mo.id_object_type in(607,609,608) /*query_vars_where*//*query_vars_where / touristic */ and tbpT.`duration` >= 1 order by tbpT.duration asc limit -1,1