I want to have specific form number as M-0001, M-0002 and so on. How to set leading zeros behind every number and set starting text as M- ?
Asked
Active
Viewed 23 times
0
-
https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_lpad – Ergest Basha Dec 13 '21 at 11:37
-
1It is best not to do that in the database. Instead do that as part of the Presentation Layer in the PHP code. Then you can leave the column in the database as a simple AutoIncrement – RiggsFolly Dec 13 '21 at 11:37