Incremental Date Based ID
| From: | Kevin Murphy | Date: | Wed, 08 Mar 2006 00:46:45 +0000 |
| Subject: | Incremental Date Based ID | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-231630@lists.php.net to get a copy of this message | ||
I'm trying to set up an ID field that works like this for news articles that are posted to a website.
2006-03-05a
2006-03-05b
I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).
The problem is if there has been something deleted.
2006-03-05a
2006-03-05c
If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted.
So, is there any way of generating this style ID number automatically?
--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326