Guest OTD Posted July 11, 2007 Share Posted July 11, 2007 Wondering if anyone knows how to reset the Product Id within cubecart, basically i tried to import a large database about 800 plus products unfortunately didnt work to plan, and now when i try to add more products its giving a product id off for example 879 following on from the previous products, i have deleted all and gone in to mysql and ensured all are deleted, but still getting a high product id. Any idea how i can set this back to 1?? Please help Many Thanks Chris Quote Link to comment Share on other sites More sharing options...
Guest OTD Posted July 11, 2007 Share Posted July 11, 2007 Anyone help at all ?? Quote Link to comment Share on other sites More sharing options...
Guest OTD Posted July 12, 2007 Share Posted July 12, 2007 ?? No One ?? Quote Link to comment Share on other sites More sharing options...
burgensteen Posted July 12, 2007 Share Posted July 12, 2007 Without checking the db (so i dont know the names off hand of tables and colums) This is the sort of thing you need to do. This will delete the column id $query="ALTER TABLE <!--your table name--> DROP COLUMN <!--your column name"; mysql_query($query); This will recreate the column id from 1 upwards $query="ALTER TABLE <!--your table name--> ADD COLUMN <!--your column name-->INT NOT NULL AUTO_INCREMENT PRIMARY KEY"; mysql_query($query); Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2007 Share Posted July 13, 2007 Not sure that's the best thing to do Burgensteen.... If you're willing to play around in PHPMyAdmin a bit, these bits of SQL will fix your problem. TRUNCATE CubeCart_inventory; TRUNCATE CubeCart_cats_idx; To remove all categories also, add in this one... TRUNCATE CubeCart_categories; The TRUNCATE command empties a table of all data and resets any AUTO_INCREMENT counters. http://dev.mysql.com/doc/refman/4.1/en/truncate.html :) Quote Link to comment Share on other sites More sharing options...
Guest OTD Posted July 16, 2007 Share Posted July 16, 2007 Sir William Thats Great....That Works a treat Very Handy Tip Here!!!! Many Thanks Quote Link to comment Share on other sites More sharing options...
burgensteen Posted July 16, 2007 Share Posted July 16, 2007 Bill, thanks for correcting me on this, I always get confused on which is the more stable way of doing this <_< Quote Link to comment 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.