View Single Post
Old 05-17-2007, 10:49 AM   #1 (permalink)
dongan
Inactive
 
Join Date: 05-08-07
Posts: 2
iTrader: 0 / 0%
Latest Blog:
None

dongan is liked by many
How to generate and insert serial no

Hi,

table name: serial

ID (int 8 primary key)
SerialNo (int 8 not null)

The serial no should be 12000001 (12 is always default. 1 is the ID of the record and remaining will be filled with 0. In total it should be 8 digits)

now, say the first record should be

1 - 12000001
2 - 12000002
3 - 12000003
....
15 - 12000015
.....
200 - 12000200
....
10001 - 12001001

Can anyone tell me what is the mysql query and php code?

Any help is greatly appreciated.

Thanks.

Regards,
Dongan
dongan is offline   Reply With Quote