I have a database in which I have record of patients, for example id
, name
, time
, date
, regularity
, etc. Now I want to add a new field medical-record-number
, I mean another integer field and auto-increment it on daily basis. I use MySQL and PHP. Thanks in advance.
Asked
Active
Viewed 209 times
0

Sharanya Dutta
- 3,981
- 2
- 17
- 27

Rasheed
- 23
- 5
-
1why not use `id` as `medical-record-number`? – jogesh_pi Feb 17 '14 at 05:00
-
possible duplicate: http://stackoverflow.com/questions/217945/can-i-have-multiple-primary-keys-in-a-single-table#answer-217952 – jogesh_pi Feb 17 '14 at 05:02
1 Answers
0
try this
$sql = "ALTER TABLE `patient` ADD `medical-record-number` int(10) AUTO_INCREMENT";
mysqli_query($sql);

Satish Sharma
- 9,547
- 6
- 29
- 51