Generate number depending on last insert!??
Posted: Fri Nov 23, 2007 6:36 am
I'm trying to generate a new number/next number depending on the last number inserted into my db???
In my DB I have a column where the numbers look like this:
00001.00001
00001.00002
00001.00003
00002
00003.00001
00004
etc. etc.
This is done for pages to find its place in a hierarchy.
My question is as follows:
Is it possible to make a script that looks into the dbtable and finds out what the last number in ex. 00001.xxxxx, and then generates the next comming number? And if yes... How.
In my DB I have a column where the numbers look like this:
00001.00001
00001.00002
00001.00003
00002
00003.00001
00004
etc. etc.
This is done for pages to find its place in a hierarchy.
My question is as follows:
Is it possible to make a script that looks into the dbtable and finds out what the last number in ex. 00001.xxxxx, and then generates the next comming number? And if yes... How.