Reset The Order ID ValueLast Update: 26th July, 2005
Article ID: 31



Introduction

New orders that are made with new osCommerce installations start with the ID of 1.

This value can be reset so that new orders are assigned an ID from a specific starting range, for example from 1000.

Solution

The following SQL query needs to be executed with MySQL or phpMyAdmin.


alter table osc_orders auto_increment = 1000;



The above query will assign an ID of 1000 to the next order made.

Alternate Solution

Also, there is lots of flexibility on what the ID number can be, however as the orders_id field in the database is of type signed integer, the ID must exist in the following range:

-2147483648 to 2147483647


Higher ID numbers can be achieved by converting the orders_id field type from signed integer to unsigned integer, which allows the following range to be used:

0 to 4294967295


or, by changing the orders_id field type to big integer, which allows the following range to be used:

-9223372036854775808 to 9223372036854775807


Unsigned big integer fields allow the following range to be used:

0 to 18446744073709551615


References

 

 

Trademark Policy | Copyright Policy | Sitemap

Copyright © 2000-2005 osCommerce. All rights reserved.