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 publish = 'yes' order by `image_order`, `image_id`' at line 1 Getting a list of products to display