dumdumsareyum Posted February 29, 2008 Share Posted February 29, 2008 Hi! Is there a way when I create a column that is a serial ID for it to format it like "000001" (however many places i want shown) instead of starting with just "1"? Thanks! Link to comment https://forums.phpfreaks.com/topic/93613-format-for-serial-id/ Share on other sites More sharing options...
aschk Posted February 29, 2008 Share Posted February 29, 2008 I think you need to specify the column to be ZEROFILL when you create the table. Link to comment https://forums.phpfreaks.com/topic/93613-format-for-serial-id/#findComment-479844 Share on other sites More sharing options...
fenway Posted February 29, 2008 Share Posted February 29, 2008 Don't mess up your IDs in the DB... format this on the way out with LPAD(). Link to comment https://forums.phpfreaks.com/topic/93613-format-for-serial-id/#findComment-479951 Share on other sites More sharing options...
aschk Posted February 29, 2008 Share Posted February 29, 2008 Good call fenway. A much better solution. Link to comment https://forums.phpfreaks.com/topic/93613-format-for-serial-id/#findComment-480159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.