Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  How to define opts['key'] when primary key is composite?

phpMyEdit General     How to define opts['key'] when primary key is composite?
Post new topic   Reply to topic    
 
amoghhooshdar     Joined: 30 Jan 2008   Posts: 2  
Post Posted: 2008-01-30 11:22
Back to top  Reply with quote     

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

Code:
$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:-

Code:
PRIMARY KEY (name, surname, suffix)


How can I express this as a key in PHPMyEdit?

 
myksa     Joined: 16 Oct 2007   Posts: 14  
Post Posted: 2008-02-04 09:53
Back to top  Reply with quote     

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.

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy