Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 24. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Generated ID/Key

phpMyEdit Configuration     Generated ID/Key
Odoslať novú tému   Odpovedať na tému    
 
techrestore     Založený: 06.05.2004   Príspevky: 1  
Príspevok 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
Príspevok 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
Príspevok 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    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov