Two fields between different tables how to associate inserts

Source: Internet
Author: User
The User table field has

ID username Password e-mail

The Mibao table field has

ID e-mail Q1 Q2 Q3

The effect I want to achieve is to keep the E-mail fields of the user table and the security table consistent, how should this be done?
Do you have anything else to improve on creating a table? Ask the Great God ~ ~ ~


My ultimate goal is to pass the mailbox verification after jump to the secret protection page fill in the secret security to obtain the password.


Reply to discussion (solution)

Consider using foreign keys, but there are too many constraints that you may not be able to manage
You can also consider using triggers
The simple point is to insert the Mibao table immediately after inserting the user table

Consider using foreign keys, but there are too many constraints that you may not be able to manage
You can also consider using triggers
The simple point is to insert the Mibao table immediately after inserting the user table

How to achieve it? Insert the Mibao table after the email field is inserted into the user table ...

Email is inserted in the User table and Mibao table when registering, you should be the ID of UserID why not in a table?

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.