[HOW TO] Auto Increment

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 4, 2010   (RSS)

Re: [richb] [HOW TO] Auto Increment

By Jason - August 4, 2010

Hi,

The num field in any section is an auto increment field. What you need to do is to start it off at 5000, you need to execute a mysql statement. (You should only attempt this if you're comfortable with SQL).

The easiest way to do this is to get a copy of our MySQL console plugin (http://www.interactivetools.com/add-ons/detail.php?MySQL-Console-1011)

After you've installed the plugin, you can execute a sql statement that will change your table. The follow example assumes that your table prefix is cms_ (you can find out what yours is in the General Settings section of CMS Builder)
ALTER cms_TABLENAME AUTO_INCREMENT=5000;

Here you'd have to change TABLENAME to the name of your product table. The num field will now autoincrement starting at 5000.

WARNING: Executing SQL statements directly on your database can have unforeseen results. There are no safety features built into the MySQL Console plugin. Only attempt if you're comfortable with using MySQL and always make a backup of your database before trying this.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/