agravayne Posted April 18, 2008 Share Posted April 18, 2008 Hello All, Not sure of this is possible but I need to create a table with an autoincrement to a specific format. it shuld be 10 didgits ling and start with 03. I could just start the autoincremet at 300000000 but of course there's no leading zero. Has anyone got any ideas? Scott Link to comment https://forums.phpfreaks.com/topic/101663-autoincrement-format/ Share on other sites More sharing options...
fenway Posted April 18, 2008 Share Posted April 18, 2008 Hello All, Not sure of this is possible but I need to create a table with an autoincrement to a specific format. it shuld be 10 didgits ling and start with 03. I could just start the autoincremet at 300000000 but of course there's no leading zero. Has anyone got any ideas? Scott Well, in theory you could use ZEROFILL, but I would recommend use a normal column and then simply LPAD() it on the way out. Link to comment https://forums.phpfreaks.com/topic/101663-autoincrement-format/#findComment-520290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.