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