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 'ORDER BY s.sort_index' at line 14
SELECT s.*, s.name_ukr as name, s.descr_shot_ukr as descr_shot, s.html_ukr as html, s.html_section_ukr as html_section, s.page_name_ukr as page_name, s.name_ukr as name, s.description_ukr as description, s.title_ukr as title FROM states_content s WHERE s.status = 1 AND s.page_name_friendly_url = 'important' AND s.state_id = ORDER BY s.sort_index