Forum Moderators: coopster
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
If you perform this little trick it will do what you want
TABLE `serial`
id INT NOT NULL auto_increment
no serial number in mysql
then in query:
SELECT ID, 12000000 + ID AS SerialNo FROM serial;
and voile
Hope this helps.
Michal