Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  How to define opts['key'] when primary key is composite?

phpMyEdit General     How to define opts['key'] when primary key is composite?
Odoslať novú tému   Odpovedať na tému    
 
amoghhooshdar     Založený: 30.01.2008   Príspevky: 2  
Príspevok Zaslal: 2008-01-30 11:22
Návrat hore  Odpovedať s citátom     

Currently, I can see that a key can be based on one column only. Like...

Kód:
$opts['key'] = 'name'
$opts['key_type'] = 'int';


How can I have a key if my table has a composite key (and there is no one column which has unique value in all rows)?

I have a primary composite key like this:-

Kód:
PRIMARY KEY (name, surname, suffix)


How can I express this as a key in PHPMyEdit?

 
myksa     Založený: 16.10.2007   Príspevky: 14  
Príspevok Zaslal: 2008-02-04 09:53
Návrat hore  Odpovedať s citátom     

You can add a field to your table which would be a primary key.

If You want to have that triple (name, surname, sufix) unique, You can use triggers to check how the fields was filled by the user.

 
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