Jump to content
Killersites Forums

reseting product id


Recommended Posts

i have been trying for a while now to set up a database system with a few products in it

 

while trialing my pages i have been editing deleting items just to check that my admin system works fine

 

 

now i have deleted so many items in my database that the first item showing although i had deleted the other items, shows item 24 as really being my first item in my database

 

 

can i reset something in my database as it still thinks i have 24 items in my database where i have only 1 item

 

 

thanks in advance

Link to post
Share on other sites

I imagine you have used an autoincremented id for your products. That number won't reset itself -- so, say you have 5 products, with ids of 1 through 5. Deleting item #2 won't reset the ids of items 3-5, and the next item you ad will have an id of #6. That's just the way autoincrement works.

 

You can reset the autoincrement value for the table: http://tycoontalk.freelancer.com/php-forum/32507-reset-auto-increment-in-mysql.html but your best bet would probably to not assume that a product id indicates the number of items/item position. As in, if the highest product id is 49, don't assume that you have 49 products.

Link to post
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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
×
×
  • Create New...