How do I retrieve a multi-column PK in MySQL?
For example I have my primary key setup as PRIMARY KEY (donor_id,country_id)
Now if I want to get the primary key value without concatenating those 2 fields in a select query, how do I do that? I want to use this in a view (or better yet, directly in phpmaker).
It’s not clear what you mean by ‘without concatenating’. A simple
will retrieve the records; you don’t need to apply a
CONCATENATE()function or anything like that. This is the Right Way to select two records from a table; the fact that they both happen to be declared part of the primary key changes nothing.