4 Digit ID with Leading Zeros
| From: | Rahul S. Johari | Date: | Thu, 15 Dec 2005 14:53:46 +0000 |
| Subject: | 4 Digit ID with Leading Zeros | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-227468@lists.php.net to get a copy of this message | ||
Ave,
I want to assign a 4 Digit ID with leading zeros to each record added using
a form I have created.
The PHP scripts does two things:
(a) It adds the data to a mySQL table
(b) it generates a CSV file with the data
The 4 Digit ID (beginning from 0001) will be used in two places:
(a) It will be the ID for the record in the mySQL table, instead of the
usual ID that we create in mySQL. It will be a Primary Key, Not Null,
Auto_Increment
(b) It will also be the filename for the CSV file.
So basically it has to match the record adding in the mySQL table and the
filename for the CSV.
I¹m trying to figure out how to do this but am not sure.
Any help appreciated.
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: rahul@informed-sources.com
http://www.informed-sources.com