You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ri.Active = 1 and ri.IsFeatured = 1 ORDER BY RAND() LIMIT 1' at line 6

SELECT ri.*, rd.Title, rd.Description, rd.ShortDescription FROM chm_Recipe_Info ri INNER JOIN chm_Recipe_Data rd ON rd.Recipe_InfoID = ri.ID and rd.Locale_InfoID = 1 INNER JOIN chm_Recipe_ProductLink rp ON rp.Recipe_InfoID = ri.ID WHERE rp.Product_InfoID = AND ri.Active = 1 and ri.IsFeatured = 1 ORDER BY RAND() LIMIT 1