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 'range,META,quantityOnHand,longDescription,cat.categoryDescription,catagories.spe' at line 1 SELECT product.productCode,productline.catagory,manf.ref,catagories.catagoryRef,catagories.catagoryName,description,ROUND(product.price+((product.price)*IFNULL(seed,80))/100,2) as calc,product.special,manf.name,product_images.name,product_images.ext,options,thisoption,productline.productLineCode,product.image,cat.catagoryRef,cat.catagoryName,range,META,quantityOnHand,longDescription,cat.categoryDescription,catagories.special,catagories.inseason,catagories.hidden,cat.special,cat.inseason,cat.hidden,catThree.catagoryRef,catThree.catagoryName,catThree.special,catThree.inseason,catThree.hidden,barcode,sellingPrice,suppRef,weight,deptCode,mainSuppCode,per,perSize,productline.hidden,actualDeptCode,deptPriceSeed,seasonStart,seasonEnd,onOrder FROM productline LEFT JOIN product on productline.productLineCode=product.productLineCode LEFT JOIN manf on productline.manf=manf.ref LEFT JOIN product_images on productline.productLineCode=product_images.name LEFT JOIN catagories on productline.catagory=catagories.catagoryRef LEFT JOIN catagories as cat on productline.secondaryCat=cat.catagoryRef LEFT JOIN catagories as catThree on productline.thirdCat=catThree.catagoryRef LEFT JOIN deptpriceseed on productline.actualDeptCode=deptpriceseed.ref WHERE (productline.productLineCode='061963' AND productline.hidden!='true')