I would like to create a serial number the following way.
The serial number should go back to 01 with the start of each month.
$stockno=dofetch(doquery("Select count(id) from vehicle",$dblink));
$stock_no= date("Ymd")."-".$stockno=$stockno["count(id)"]+1;
output is
20150424-01
20150424-02
20150424-03
...
20150430-120
20150501-121
20150501-122
20150502-122
but need Result below format, when new month start serials will be reset
20150424-01
20150424-02
20150424-03
...
20150430-120
20150501-01
20150501-02
20150502-03
new month start again reset to 1
20150601-01
etc.