Ask the great God for questions about database design

Source: Internet
Author: User
Ask the great God for questions about database design
I am a rookie, recently in the development of a repair system based on PHP+MYSQL, developed to half found the structure of the database has a serious error.




The main problem appears on the association of the user table and the Web_order table, the primary key UID of the user table is associated with the foreign key of the Web_order table, and the value of W_workid in the Web_order table is also the value of the UID field of the user table. Reason in the user permissions with my user table is only used in a power field to differentiate, this system has ordinary users, maintenance staff, Secretary, Administrator 4 permissions, the system logically need to mark the repair of the (user), who repair (the maintenance staff), who is assigned (Secretary), which let me not know how to associate, How to change the table structure, please greatly help, thank you. Database MySQL


------Solution--------------------
The Web_order table will have a record when the repair is repaired.
The Web_order table will have a record during maintenance.
The Web_order table will also have a record when assigned
How could it not be connected?
------Solution--------------------
Since the secretary assignment and the repairman answer list are indicated by the State field of the Update table, the record is not added
Then there's no place for you to record who's doing it.
So naturally, it's impossible to tell who's doing what.
Can't you find a solution to such an obvious problem?
------Solution--------------------
Add an operation log table, record the personnel time what operation and so on information

  • 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.