devan Posted November 21, 2011 Share Posted November 21, 2011 Hi, I am getting the following error in my UPDATE query : 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 'WHERE `productId`='1143'' at line 12 My code : $sqlEdit = "UPDATE CubeCart_inventory SET `productCode`='$prodcode', `quantity`='$prodqsa', `description`='$proddes', `image`='$imagesaveme2', `price`='$prodsell', `name`='$prodtitle', `cat_id`='$category', `sale_price`='$prodsale', `stock_level`='$prodqty', `Prod_Condition`='$prodcon', `Prod_Waiting`='$prodperiod', WHERE `productId`='$prodid'"; $result = @mysql_query($sqlEdit); What might be the problem ? MySQL is saying line 12 is wrong : This Line : WHERE `productId`='$prodid'"; please help! Link to comment https://forums.phpfreaks.com/topic/251529-you-have-an-error-in-your-sql-syntax/ Share on other sites More sharing options...
joel24 Posted November 21, 2011 Share Posted November 21, 2011 you don't need a comma after the last line Prod_Waiting`='$prodperiod', #remove this comma. WHERE Link to comment https://forums.phpfreaks.com/topic/251529-you-have-an-error-in-your-sql-syntax/#findComment-1289920 Share on other sites More sharing options...
devan Posted November 21, 2011 Author Share Posted November 21, 2011 EXCELLENT, thank you so much !!!! Link to comment https://forums.phpfreaks.com/topic/251529-you-have-an-error-in-your-sql-syntax/#findComment-1289925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.