SELECT pt.name
			FROM pages p
			INNER JOIN pages_text pt ON p.id = pt.page_id AND pt.language_id = 1
			INNER JOIN premises_relations pr ON p.id = pr.page_id
			WHERE pr.premise_id = 
			AND p.category = 'parameters'
			AND p.status != 'deleted'
			ORDER BY p.order_id
			

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 'AND p.category = 'parameters'
			AND p.status != 'deleted'
			ORDER BY p.orde...' at line 6

file -
line -