0
I’m developing a system that registers employees of companies.
In this system I have the staff tables and users.
Table employees have the data
id|nome|empresa|data_cadastro|user_view|user_edit
User table have the data
id|nome|empresa
The User when accessing the system with email and password, saves the session of the user ID.
I would like it when users view the employee profile, their ID is recorded in the employee table in the user_view column. That in the case are at least 5 users, to know who saw each profile.
How to write to the employee table? To display which users have already seen your profile. Same function to know if the employee profile has been edited by any user. I can write an ID at a time through an Insert in the table, but how to write multiple ID in a single column, or another way that can perform the same process.
It wouldn’t look too big on that bench. I thought about creating another column in the employees table, with the user name, and only insert ID value, then just consult in the bank and make a comparison between this column and the user ID to display.
– Marcelo Rossi
Thinking like you said... there will be some questions... how will you maintain this data? imagine that the user diego, can change these data more than once.. not to mention that if everyone edits the record, they also won’t know what the last change was.. in my opinion the ideal would be even another table.. log..
– Diego Lela
there will be no slowness because the banks today are geared to this, you can index in the searches, when you create this table, think about creating fields as date of registration and date of modification, beyond the employee id of course, for you to have this information when you need..
– Diego Lela