Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How phpmyadmin creates constraints

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to create constraints phpmyadmin, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!

How does phpmyadmin create constraints? The method of establishing Foreign key constraint by using phpmyadmin

In the past, we used SQL statements to associate primary foreign keys, but now it is much more convenient to use visual phpmyadmin, but when we do primary foreign key constraints, we can't find where the operation is. Online search is also a variety of strange, all said is very obscure, many say that you need to use insert sql statements, in fact, do not need, look at the steps:

I set up two tables:

Table 1:class1 (master table)

Table 2: class2: (attached)

At this point, I want to associate the name in class1 with the data_name in class2. At this time, we need to pay attention to a few points:

First: there can be multiple foreign keys in the primary table, and the foreign key and the primary key of the primary table can be repeated, but the foreign key must be the primary key of the schedule, and the type must be the same.

Second: the type of both tables must be InnoDB engine, which can be set when the table is created:

Of course, it doesn't matter if we set up a table, it can still be set up:

At this time, you can see in the table that there is an associated view, which may have something to do with the version, and some will be in the

There is a relationship check in this place

Click:

These are all the contents of the article "how phpmyadmin creates constraints". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 293

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report