|
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
|