1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') kc JOIN ( ...' at line 48

SELECT tf.width as front_tyre_width, tf.height as front_tyre_height, tf.ean as front_ean, tf.name as front_tyre_name, tf.runflat, tf.image as tyre_image, tf.specifications as front_specifications, atlf.name as front_loadindex, atsf.name as front_speedindex, IFNULL(atef.name,'') as front_ean_name, tr.width as rear_tyre_width, tr.height as rear_tyre_height, tr.ean as rear_ean, tr.name as rear_tyre_name, tr.specifications as rear_specifications, atlr.name as rear_loadindex, atsr.name as rear_speedindex, IFNULL(ater.name,'') as rear_ean_name, atmf.name as tyre_manufacturer, atmof.name as tyre_model FROM ads_tyres_2_1600 tf JOIN ads_tyres_manufacturers atmf ON (atmf.id=tf.manufacturer) JOIN ads_tyres_models atmof ON (atmof.id=tf.model) JOIN ads_tyres_loadindex atlf ON (atlf.id=tf.loadindex) JOIN ads_tyres_speedindex atsf ON (atsf.id=tf.speedindex) LEFT JOIN ads_eans atef ON (atef.id=tf.ean), ads_tyres_2_1600 tr JOIN ads_tyres_loadindex atlr ON (atlr.id=tr.loadindex) JOIN ads_tyres_speedindex atsr ON (atsr.id=tr.speedindex) LEFT JOIN ads_eans ater ON (ater.id=tr.ean), ( SELECT DISTINCT f.tyre_width as front_tyre_width, f.tyre_height as front_tyre_height, r.tyre_width as rear_tyre_width, r.tyre_height as rear_tyre_height FROM ( SELECT DISTINCT front_complect, rear_complect FROM kfz_complects WHERE kfz_id= ) kc JOIN ( SELECT tyre_width, tyre_height, id FROM complects WHERE radius = 1600 ) f ON (f.id=kc.front_complect) JOIN ( SELECT tyre_width, tyre_height, id FROM complects WHERE radius = 1600 ) r ON (r.id=kc.rear_complect) ) sizes WHERE tf.id=1219061 AND tr.id=1219061 AND tf.manufacturer=tr.manufacturer AND tf.model=tr.model AND tf.runflat=tr.runflat AND tf.load >= 0 AND tf.speed >= 0 AND tr.load >= 0 AND tr.speed >= 0 AND tf.width = sizes.front_tyre_width AND tf.height = sizes.front_tyre_height AND tr.width = sizes.rear_tyre_width AND tr.height = sizes.rear_tyre_height

[TEP STOP]