MySQL Forums
Forum List  »  Newbie

Incrementing an int
Posted by: Raymond Jender
Date: June 03, 2021 04:19PM

So I know enough about mySQL and PHP to be dangerous.

I have an int(8) in a database table. It's format is yrmonthxxxx so for example it would look like 21060001. 21 = year, 06 = month, and xxxx would just be a number from 0001-9999, although I don't ever see it going that high.

So for every job request, the 0001 would be incremented by one. The issue I have is how to change the yr and month when it needs to change. I may have to reset the xxxx for every new month. It actually makes sense to reset it, as it would tell you how many jobs for each month.

But right now how to change the year and month efficiently.

Thanks,

Ray

Options: ReplyQuote


Subject
Written By
Posted
Incrementing an int
June 03, 2021 04:19PM
June 03, 2021 04:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.