pk123hk2003 Posted August 1, 2013 Share Posted August 1, 2013 Hi guys I am having hard to on managing my product_ids within my shop, after a couple deletions my product_id starts skipping. for example i would have id form 1 ~ 5 and then 9~13 and 18~21 Now I am just trying make them all continues again so that i could keep track of them easily in the future. i really need your help:)!!! thank you!! Link to comment Share on other sites More sharing options...
NemoPS Posted August 1, 2013 Share Posted August 1, 2013 Hi, you mean you want to reset the product id in the database? In this case use the following query in your database ALTER TABLE ps_product AUTO_INCREMENT = 1 Of course use your number insterad of 1! Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 hmm but altering will not crash the db in this case? there are some rows related to the products, in this case it will be also necessary to change other database fields where the id_product field are stored just thinking Link to comment Share on other sites More sharing options...
pk123hk2003 Posted August 2, 2013 Author Share Posted August 2, 2013 Thank you for replying, i just tried using "ALTER TABLE ps_product AUTO_INCREMENT = 1", but nothing happened, i then click back to ps_product and check my product id they all says the same, could you explain more about it ? Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2013 Share Posted August 2, 2013 have you got an access to the phpmyadmin? Link to comment Share on other sites More sharing options...
NemoPS Posted August 2, 2013 Share Posted August 2, 2013 hmm but altering will not crash the db in this case? there are some rows related to the products, in this case it will be also necessary to change other database fields where the id_product field are stored just thinking Well, not if you deleted all products coming next, as this is the only table which auto increments the product id as far as I know. All the related ones us INSERT_ID to get it from that table Link to comment Share on other sites More sharing options...
stottycabanas Posted August 2, 2013 Share Posted August 2, 2013 pk123hk2003 - did you enter 'ALTERTABLE' or 'ALTER TABLE'? There's a significant difference! Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2013 Share Posted August 2, 2013 yea, stottycabanas has got absolutely right, I have not seen this before Link to comment Share on other sites More sharing options...
NemoPS Posted August 2, 2013 Share Posted August 2, 2013 Oh course, if you put ALTERTABLE, it won't work, there is a space inbetween Link to comment Share on other sites More sharing options...
Recommended Posts