6
How to generate sequential numbers consisting of year, month, 5-digit sequence. where the digits are zero when changing the month?
Example:
14 // ANO
11 // MÊS
00000 // SEQUÊNCIA QUE AO MUDAR O MÊS ZERA
Staying: 141100000
..141100001
..141100002
When changing the month: 141200000
..141200001
..141200002
These numbers are assigned to a service order and saved in DB, obviously they will be unique.
My job is like this:
function generateNumber(){
return date('ym').'00000'; //141100000
}
you will assign this number when entering a new order in DB, correct?
– Bruno Calza
correct @Brunocalza
– smigol
q DB are you using? maybe I got easier to do in sql
– Bruno Calza
is mysqli ... :)
– smigol
This field is a varchar or int? in this service order table there is a field
data_de_entrada
ordata_de_registro
?– rray
Hi @lost, the column os_numero referred to above, is of the VARCHAR type, tbm has a column date timestamp
– smigol