Auto increment from a specific value [SOLVED]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hairyjim
Forum Contributor
Posts: 219
Joined: Wed Nov 13, 2002 9:04 am
Location: Warwickshire, UK

Auto increment from a specific value [SOLVED]

Post by hairyjim »

Hi all,

Is it possible to auto increment a field, but instead of starting from 1 I want it to start from 44403707. Is this possible?
Last edited by hairyjim on Wed Nov 17, 2004 9:12 am, edited 1 time in total.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Using which Database system....
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

yes just insert a value into your auto increment column along with the rest of the record
ie 12849, bob, smith
next record will auto_increment to 12850
hairyjim
Forum Contributor
Posts: 219
Joined: Wed Nov 13, 2002 9:04 am
Location: Warwickshire, UK

Post by hairyjim »

Whoops yeah sorry. MySQL.

Cheers Scott - I should have thought of that!
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

You can specify the start value of the auto_increment column when you create the table, check your MySQL manual regarding table creation and auto_increment columns.
Post Reply