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 is_primary = 0 ORDER BY news_images.ID' at line 1
Function trace_message in "/disk2/home/ulsu/public_html/include/db.class.php" at line 23.
Failed Statement : 

SELECT * FROM `news_images` WHERE newsID =  AND is_primary = 0 ORDER BY news_images.ID