phpmyadmin 和外键
我向我的字段之一添加了外键约束。
插入时,该字段显示为下拉菜单而不是预期的文本框。
但下拉菜单中的每个值都会列出两次,一次在值之前有一个减号,一次在值之后有一个减号。
像这样:
- value1
- value2
- value3
value1 -
value2 -
value3 -
这是什么意思?
I added a foreign key constraint to one of my fields.
On insert, the field is showing up as a drop down instead of a text box, as expected.
But the drop down has each value listed twice, once with a minus sign before the value and once with the minus sign after the value.
Like this:
- value1
- value2
- value3
value1 -
value2 -
value3 -
What does this mean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,Phpmyadmin 显示外键值和旁边的自定义描述字段(在表的“关系视图”中设置),并用连字符分隔。
另请参阅 phpMyAdmin 常见问题解答 6.21,“在编辑/插入模式下,如何查看基于列的可能值列表在某个外国表上?”。
Phpmyadmin by default shows foreign key value and a custom description field next to it (which is set in "Relation view" for the table) separated by hyphen.
See also the phpMyAdmin FAQ 6.21, "In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table?".
如前所述,确实必须设置 pmadb,但我发现这是自动设置的。您需要做的是:
然后当你去插入时你会发现你可以看到整数和相应的名称 - 即:1 - 公司名称
As mentioned, pmadb does have to be set up however I found that this is set automatically. What you need to do is:
When you then go to insert you will find that you can see the both the integer and the corresponding name - ie: 1 - Company name