zeusthegreat Posted October 15, 2011 Report Share Posted October 15, 2011 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 Quote Link to comment Share on other sites More sharing options...
falkencreative Posted October 15, 2011 Report Share Posted October 15, 2011 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. 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.
Note: Your post will require moderator approval before it will be visible.