13thjoker Posted November 6, 2017 Share Posted November 6, 2017 I made the next code. Db::getInstance()->delete('attribute_cart_print', 'cat_id = 28 AND cart_id = '.$cart.''); Its a table custom made. Would be cool if someone helped out. Becaulse im lost Link to comment Share on other sites More sharing options...
ENS Enterprises Posted November 6, 2017 Share Posted November 6, 2017 Hi, Can you please let me know what you want to do? Link to comment Share on other sites More sharing options...
13thjoker Posted November 7, 2017 Author Share Posted November 7, 2017 i want to delete row in attribute_cart_print with cat_id = 28 and cart_id = $cart Its one of my tables. So Link to comment Share on other sites More sharing options...
cristic Posted November 8, 2017 Share Posted November 8, 2017 First check what value $cart has. Then, see if this return something: select * from attribute_cart_print where cat_id = 28 AND cart_id = $cart #replace $cart with the exact value If no rows are returned, then there is nothing to delete. Link to comment Share on other sites More sharing options...
13thjoker Posted November 8, 2017 Author Share Posted November 8, 2017 $result = Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'attribute_cart_print` WHERE cat_id = '.$Cat3.' AND cart_id = '.$cartid.' AND product_id = '.$product); Returns 1 so Link to comment Share on other sites More sharing options...
13thjoker Posted November 8, 2017 Author Share Posted November 8, 2017 Fixed Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now