QUERY: SELECT p.*, pCatPrimary.title AS parent1Title, pCatPrimary.title_key AS parent1TitleKey, pCatPrimary.level AS parent1Level, parent1.title AS parent2Title, parent1.title_key AS parent2TitleKey, parent1.level AS parent2Level, parent2.title AS parent3Title, parent2.title_key AS parent3TitleKey, parent2.level AS parent3Level, parent3.title AS parent4Title, parent3.title_key AS parent4TitleKey, parent3.level AS parent4Level, secParent1.title AS secParent1Title, secParent1.title_key AS secParent1TitleKey, secParent1.level AS secParent1Level, GROUP_CONCAT(pCatSec.title SEPARATOR ',') AS additionalCategoryTitles, GROUP_CONCAT(pCatSec.title_key SEPARATOR ',') AS additionalCategoryKeys, cStars.label AS starsLabel, IFNULL(cSkillLang.label, cSkill.label) AS skillLabel, cSkill.label AS skillLabelKey, cSkill.sort AS skillLabelSort, guide.name AS guideName, g.filename, g.filepath, g.sort, g.title as imageTitle, g.description as imageDescription, o.FK_gallery_id, o.FK_visibility FROM fla_ponudniki p JOIN fla_objects o ON (p.FK_object_id = o.object_id) JOIN fla_content pCatPrimary ON (p.FK_category = pCatPrimary.content_id) LEFT JOIN fla_content parent1 ON (pCatPrimary.FK_parent = parent1.content_id) LEFT JOIN fla_content parent2 ON (parent1.FK_parent = parent2.content_id) LEFT JOIN fla_content parent3 ON (parent2.FK_parent = parent3.content_id) LEFT JOIN fla_ponudnik_categories pc ON (p.ponudnik_id = pc.FK_ponudnik_id) LEFT JOIN fla_content pCatSec ON (pc.FK_category_id = pCatSec.content_id) LEFT JOIN fla_content secParent1 ON (pCatSec.FK_parent = secParent1.content_id) LEFT JOIN fla_codes cStars ON (p.stars = cStars.code_id) LEFT JOIN fla_codes cSkill ON (p.route_skill = cSkill.code_id) LEFT JOIN fla_codes cSkillLang ON (cSkill.code_id = cSkillLang.label) LEFT JOIN fla_guides guide ON (p.FK_guide_id = guide.guide_id) LEFT JOIN fla_gallery_images g ON (o.FK_gallery_id = g.FK_gallery_id AND g.album_cover = 1 AND g.visible = 1) WHERE (o.is_deleted != 1) AND (p.ponudba_id = 2015081312524209) GROUP BY p.ponudnik_id ORDER BY p.title DESC, g.filename DESC
ERROR: Unknown column 'p.ponudba_id' in 'where clause'