Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

reset product_id to 1


skunkbad

Recommended Posts

Posted

The default installation has some sample products, and once deleted, new products that are added have a product_id that starts incrementing at 28. I've managed to find in the database all of the tables that contain product_id, but even when set to 1, new products still increment from 29,30, etc. There must be some sort of count that osCommerce is keeping, but I can't find it. How is osCommerce keeping track of the product ID number, and how can I reset it or change it?

No Links To My Website Here!

Posted

I don't know the answer, but curiosity got the better of me....

:blush:

 

As long as the bloody thing works, what does it matter if it's 1 or 1111111?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
I don't know the answer, but curiosity got the better of me....

:blush:

 

As long as the bloody thing works, what does it matter if it's 1 or 1111111?

:unsure:

 

Well, it doesn't really matter, but I'm sorta a perfectionist like that. Judging by your post count, I'd think that this would have been an easy thing for you to tell me about. I still can't find where the product_id is incrementing from.

No Links To My Website Here!

Posted

Ummm... I'm a PHP freak.

 

I can't even spell MYSQL, and that's what you need.

;)

 

If I could help I would.

 

I'm a "perfectionist" about other things myself.

:lol:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
The default installation has some sample products, and once deleted, new products that are added have a product_id that starts incrementing at 28. I've managed to find in the database all of the tables that contain product_id, but even when set to 1, new products still increment from 29,30, etc. There must be some sort of count that osCommerce is keeping, but I can't find it. How is osCommerce keeping track of the product ID number, and how can I reset it or change it?

The column products_id is an auto-increment column. According to the MySQL site (user comments) you should be able to make MySQL starting with a low number again:

In order to reset the auto_increment, in a situation where some of the most recently added rows were deleted, use:

 

ALTER TABLE theTableInQuestion AUTO_INCREMENT=1234

 

and future insertions will be numbered from 1234 again (unless you still had rows numbered greater than 1234, and then the future insertions will start from the greatest number + 1 ).

Posted

Great in retrospect I suppose but when you killed all the products you should have TRUNCATED all the product related tables.

 

TRUNCATE is in phpMyAdmin the EMPTY tab.

Posted

Funnily enough one of my add-ons does this then you can run the sql above.

 

Probably quicker to do the whole thing via phpmyadmin

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

Just don't execute the "Halt And Catch Fire" instruction...

:o

 

Assembler Opcodes which should exist

 

For anyone who's done assembly language programming, that link is hoot!

:lol:

 

(Corrected spelling error... I just washed my fingers and can't do a thing with them.)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...