DaleZA
DaleZA

Reputation: 191

Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available

I get the following notification in phpMyadmin

Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

Below is the query I ran in phpMyadmin. I have tried using on instead of Using and I have also tried removing some of the joins. The minute I uses INNER JOIN I get the notification.

I have tried to find solutions but they all involve setting an index or AI for a column

SELECT    mr.response_id, mr.user_id, mr.topic_id, mr.response,
                mt.name AS topic_name, mt.category_id,
                mu.username, mc.name AS category_name
     FROM       mismatch_response AS mr
     INNER JOIN mismatch_topic AS mt USING(topic_id)
     INNER JOIN mismatch_user AS mu USING(user_id)
     INNER JOIN mismatch_category AS mc USING(category_id)

but in all tables I have a column that is set as the primary key with Auto increment.

Not sure what else to do

Upvotes: 2

Views: 3887

Answers (2)

user3209882
user3209882

Reputation: 51

It turns out that if you use JOIN in query, phpmyadmin always shows Current selection does not contain a unique column. and disable ability to edit row. :( I tried to create 2 simple table t1 and t2. Both of them have two fields: 'id' as primary autoincrement and 'name'.

All my queries are outputting the message Current selection does not contain a unique column.:

SELECT t1.*,t2.* FROM t1 JOIN t2 ON t1.name=t2.name;
SELECT t1.id,t1.name FROM t1 JOIN t2 ON t1.name=t2.name;
SELECT t1.id,t1.name FROM t1 JOIN t2 ON t1.id=t2.id;

But if I create a view for this query, the rows become editable in phpmyadmin.

Upvotes: 0

Sanchit
Sanchit

Reputation: 541

Your all the tables might have a column as Primary Key with Auto Increment. But the result you get after executing the above query doesn't have any unique index.

All the operations i.e. Edit, Copy and Delete require a Unique Index to work, obviously you wont want all your data delete on just deleting a single data row.

Upvotes: 1

Related Questions