| Index
» Projekty
» phpMyEdit
» Fórum
» Generated ID/Key |
 |
techrestore
Založený: 06.05.2004
Príspevky: 1
Zaslal: 2004-05-06 02:25
Návrat hore
Odpovedať s citátom
|
I am trying to have a specific generated key for every addition to the database.
If its not possible to get the main key to create unique identifiers in the format that i need them, then it will be ok to create a new field to store this information.
I have transaction ID's that are setup in this way:
they started at 1001(then the date) - like this:
1001050504
the next would be 1002(then the date)
how can i get this 'transaction ID' to be coded on every new record created?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-05-06 07:10
Návrat hore
Odpovedať s citátom
|
yes, using triggers (insert before).
just make
$newvals['id'] = "whatever you want.";
the problem will be with partial autoincrement in the id, maybe an extra autoincrement column and this one calculated from it.
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-05-16 14:46
Návrat hore
Odpovedať s citátom
|
Why don't you use timestamp type ?
Regards,
--Hugues
_________________ hbernard - phpMyEdit updater.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|