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 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. 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. 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 * 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 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? 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! Link to comment https://forums.phpfreaks.com/topic/89844-solved-deleting-items/#findComment-460583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.