RE: [PHP-DB] Keeping autoincrement ID 2 digits. Possible?
| From: | Cal Evans | Date: | Thu, 28 Feb 2002 13:34:22 +0000 |
| Subject: | RE: [PHP-DB] Keeping autoincrement ID 2 digits. Possible? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17361@lists.php.net to get a copy of this message | ||
Not within the construct of auto_increment. You could , however write your
own Serial Assigned Key (SAK) routine in PHP to enforce these business
rules.
=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*
-----Original Message-----
From: Andy [mailto:news.letters@gmx.de]
Sent: Thursday, February 28, 2002 5:21 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Keeping autoincrement ID 2 digits. Possible?
Hi there,
I am wondering if it would be possible to have a autoincrement field which
is only 2 digits long. The idea is, that as soon as 99 is reached the next
value will be a free one withing 0-99.
E.g.
A forum has not more than 99 different forums. So lets say we will keep the
ID 2 digits.
Forums can be deleted and created by the admin. As soon as one is deleted,
there is an empty number. E.g. 5
So we reach 99 and the next number should be not 100 but 5!
I did set the type of the field to int(2), but it does not change anything.
Still 100.
Has anybody a good idea?
Thanx Andy
PS: if somebody is wondering why 2 digits... I am passing this value like
that : viewforum/01.html
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php