如何在 PHPMyAdmin 中启用关系?

发布于 2024-12-08 12:18:38 字数 567 浏览 0 评论 0原文

我对 MySQL 和 PHPMyAdmin 知之甚少,我将用 PHP 制作一个测验程序,它将允许用户创建、保存和进行多项选择测验。

表格当前的结构方式(如果这种结构听起来很垃圾,我愿意接受建议:)) 我有3张桌子, 测验包含:

 ID, quiz title and quiz_ID, 

答案包含:

 ID, question_ID, Answer1, Answer2, Answer3, Answer4 and correct answer

问题包含:

 ID, and the question.

我完全不知道从哪里开始创建关系来加入不同的ID。我正在使用 PHPMyAdmin,并且环顾四周,它说关系特性被禁用。所以我认为我需要做的第一件事就是启用这个功能。

如果有任何帮助,我将非常感激,请清楚地解释一下,因为我对这一切都很了解:p

再次感谢:) xx

I know very little about MySQL, and PHPMyAdmin, I have am going to make a quiz program in PHP, it will allow the user(s) to create, save and do multiple choice quizzes.

The way in which the tables are currently structured (I'm open to suggestions, if this structure sounds rubbish:) )
I've got 3 tables,
Quizzes containing:

 ID, quiz title and quiz_ID, 

Answers containing:

 ID, question_ID, Answer1, Answer2, Answer3, Answer4 and correct answer

Questions containing:

 ID, and the question.

I have absolutle no idea at all where to start in creating relationships to join ip various ID's. I am using PHPMyAdmin, and have looked around, and it says the relationship reature is disabled. So I think the first thing I need to do is enable this feature.

I would be so grateful for any help at all, and please explain it clearly because I'm pretty thick at all this :p

Thanks again in advance :) xx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

献世佛 2024-12-15 12:18:38

在表的结构视图中,列表下方有一个链接,显示“关系视图”。

还要确保您已对要建立关系的字段建立了索引

In the structure view of a table you have a link just below the list saying "Relation view".

Also make sure you have indexed the field you want to make relation on

书间行客 2024-12-15 12:18:38

教程链接

它适用于网络服务器,但它应该可以为您提供更多帮助。如果你可以修改config.inc.php,你当然不必再次安装pma。

请注意,您可以使用 JOIN 轻松连接表。请参阅此处

Link to tutorial.

It is meant for use on a webserver, but it should help you further. If you can modifiy config.inc.php, you of course don't have to install pma again.

Please note that you can easily join tables using JOIN. See here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文