pwes24 Posted February 7, 2008 Share Posted February 7, 2008 I have a simple code that just doesnt work. Can you help me point out the problem? Thank you. $prod_id = $_GET['product_id']; $query = "DELETE * FROM `shoppingcart` WHERE `pro_id`='".$prod_id."' "; Here's the error it gives me: 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 '* FROM `shoppingcart` WHERE `pro_id`='1'' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/ Share on other sites More sharing options...
mindspin311 Posted February 7, 2008 Share Posted February 7, 2008 prod_id not pro_id. Always check your spelling before posting. Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460422 Share on other sites More sharing options...
pwes24 Posted February 7, 2008 Author Share Posted February 7, 2008 The variable is ok: $prod_id. I'm trying to delete the row where .pro_id is same as the value of the variable $prod_id. Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460426 Share on other sites More sharing options...
teng84 Posted February 7, 2008 Share Posted February 7, 2008 $query = "DELETE FROM `shoppingcart` WHERE `pro_id`='".$prod_id."' "; remove the * Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460435 Share on other sites More sharing options...
mindspin311 Posted February 7, 2008 Share Posted February 7, 2008 $query = "DELETE FROM `shoppingcart` WHERE `pro_id`='".$prod_id."' "; remove the * Wow.. can't believe I overlooked that one lol Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460437 Share on other sites More sharing options...
teng84 Posted February 7, 2008 Share Posted February 7, 2008 solved? Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460467 Share on other sites More sharing options...
pwes24 Posted February 7, 2008 Author Share Posted February 7, 2008 Thank you soo much people. I can't believe I didn't catch that. My head's gonna get a beating, lol! Quote Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460583 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.