Harsh.daffodil Posted February 24, 2014 Share Posted February 24, 2014 Want to know how category id is updated when we add product at backend? Code in which file and which parameter is fetching that value? Link to comment Share on other sites More sharing options...
vekia Posted February 24, 2014 Share Posted February 24, 2014 hello you mean about product default category? Link to comment Share on other sites More sharing options...
Harsh.daffodil Posted February 24, 2014 Author Share Posted February 24, 2014 hi no when i am deleting a category and inserting the new category then id is not decrementing i.e the new id is +1 of the deleted id. why? Link to comment Share on other sites More sharing options...
vekia Posted February 24, 2014 Share Posted February 24, 2014 it's normal, this is how mysql databases works it's necessary for database consistency id_category is AUTO_INCREMENT and unique, there is no chance to create two the same unique id_category fields it mean that if you remove id_category=12 you can't create it once again, you can do it manually, but it's not a good idea... Link to comment Share on other sites More sharing options...
Harsh.daffodil Posted February 24, 2014 Author Share Posted February 24, 2014 Thanks then to get back those id what should we do? Link to comment Share on other sites More sharing options...
vekia Posted February 24, 2014 Share Posted February 24, 2014 you have to change database manually, there is no other way. create new category and change id manually in all tables like ps_category, ps_category_lang Link to comment Share on other sites More sharing options...
Harsh.daffodil Posted February 24, 2014 Author Share Posted February 24, 2014 Thanks 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