cjkeane Posted March 1, 2011 Share Posted March 1, 2011 I need to create a custom PK similar to 000111-GH. where: 0001 is the counter 11 is the year GH i need randomly generated with either numbers/letters once 2012 occurs, i need the counter to be reset to 000112-DF How would i increment 0001 until 2012, then reset the first few digits back to 0001? similarly, i will have a linked table but will have a different autonumber format for client 1 the linked data would look look like this 000111-GH-001 for record 1 000111-GH-002 for record 2 but then for client 2 000211-DS-001 00211-DS-002 Can anyone provide any assistance on how to accomplish this? thank you. Link to comment https://forums.phpfreaks.com/topic/229327-phpmysql-insert-incrimental-number-in-pk/ Share on other sites More sharing options...
Pikachu2000 Posted March 1, 2011 Share Posted March 1, 2011 This is your third thread on this same topic. Link to comment https://forums.phpfreaks.com/topic/229327-phpmysql-insert-incrimental-number-in-pk/#findComment-1181612 Share on other sites More sharing options...
cjkeane Posted March 2, 2011 Author Share Posted March 2, 2011 sorry about that. i'll refrain from double posts in the future. i was trying to find a way to delete this one but i couldnt seem to find how to. Link to comment https://forums.phpfreaks.com/topic/229327-phpmysql-insert-incrimental-number-in-pk/#findComment-1181659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.