RE: [PHP-DB] Incrementing Primary Key
| From: | Jimmy Sole | Date: | Wed, 27 Oct 2010 13:17:56 +0000 |
| Subject: | RE: [PHP-DB] Incrementing Primary Key | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47441@lists.php.net to get a copy of this message | ||
Just set the primary key to AUTO_INCREMENT on each field and you won't have
to worry about it
-----Original Message-----
From: Ethan Rosenberg [mailto:ethros@earthlink.net]
Sent: Wednesday, October 27, 2010 9:11 AM
To: php-db-lists.php.net
Subject: [PHP-DB] Incrementing Primary Key
Dear List -
Thanks for all your excellent help.
I am setting up a database for medical research, which will be conducted at
various sites. The sites will be identified by a letter {A,B,C ....}. The
medical record number [primary key] will start at
1001 and increment by one(1) for each patient at each site; ie, A 1001,
A1002, B1001, B1002 ...... How do I do this?
Do I need a separate database for each site?
Ethan
--
PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php