Jump to content

Resetting Product ID


Guest OTD

Recommended Posts

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

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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

:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...