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.*, as name, s.descr_shot as descr_shot, s.html as html, s.html_section as html_section, s.page_name as page_name, as name, s.description as description, s.title as title FROM states_content s WHERE s.status = 1 AND s.page_name_friendly_url = 'visa' AND s.state_id = ORDER BY s.sort_index