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

こ雲淡風輕ζ 提交于 2019-12-07 02:10:27

I faced same problem when I use VIEW and looks like it's phpmyadmin just can't prove that there are columns in resulting query that unique by table design. In your case it's stock_id, but since there is multiple table join and stock_id is not present in other rows it is unable to deside what row shoild be affected on edit or delete. This warning could be disabled via config

$cfg['RowActionLinksWithoutUnique'] = true

https://docs.phpmyadmin.net/en/latest/config.html#cfg_RowActionLinksWithoutUnique

Resolution: This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available

The Info button at the end of the Warning will take you to the phpMyAdmin configuration settings page where you will find:

$cfg['RowActionLinksWithoutUnique'] Type: boolean Default value: false Defines whether to show row links (Edit, Copy, Delete) and checkboxes for multiple row operations even when the selection does not have a unique key. Using row actions in the absence of a unique key may result in different/more rows being affected since there is no guaranteed way to select the exact row(s).

This explains the Configuration setting. I ran into this issue when trying to use Multiple table joins where each of the tables didn't share a unique column although each of the join I used I used Unique Primary keys to establish the joins, but no matter how many different queries I wrote the only way to accomplish a Mass Edit is either in small join queries or add fields to your table to make it join with a unique primary key of another table. Hope that is helpful!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!