0

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

Shadow
  • 33,525
  • 10
  • 51
  • 64
Hamna
  • 59
  • 7
  • https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_lpad – Ergest Basha Dec 13 '21 at 11:37
  • 1
    It 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

0 Answers0