Error in Query : SELECT DISTINCT p.iProductId, if(pl.vProductName='' OR pl.vProductName is null, p.vProductName, pl.vProductName) as vProductName, p.fPrice, p.fRetailPrice, p.vImage, p.iSEOCategoryId FROM products p LEFT JOIN products_lang AS pl ON p.iProductId = pl.iProductId AND pl.iLanId = '1' WHERE p.iProductId <> '3286' AND p.iStatus='1' and p.iSEOCategoryId= ORDER BY rand() limit 0,5
1064 : 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 'ORDER BY rand() limit 0,5' at line 1