Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OScommerce problem with database


Sagramor

Recommended Posts


After moving in new hosting provider i have problem when i insert new data in database. I check the database and the problem is with auto increasment in all fields with ID. For example customer ID - product ID - etg. When i try to insert new customer or new product i got: 1062 - Duplicate entry '...' for key 'PRIMARY'. Do i need to change some php settings in new server? (php 5.2.17)

Link to comment
Share on other sites

Which version of osC? That is an ancient version of PHP you are using there so I'm guessing you also have an ancient version of osC. Not many people are keen to help with outdated code, most would suggest you upgrade to the latest Bootstrap version

 

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

Yes, PHP 5.2 is way ancient, and you should be talking to your host about getting up to date (at least PHP 5.6). PHP 7.1 is considered the current level.

Regarding your database, I don't know if MySQL autoincrement fields always start at 0 unless you take some explicit action to reset the counter to a higher level ("set auto-increment = 432" or something like that), or if they look at the highest existing value you import, and go from there. Possibly the former is what your database is set up to do. Did you run with default values before importing your backup? Maybe it didn't realize it needs to bump up the autoincrement value for each table. You can try doing it manually in phpMyAdmin ("Next autoindex" value) and see what happens. You probably should have a backup first...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...