P
P
Parabeksha2022-03-03 19:23:06
PHP
Parabeksha, 2022-03-03 19:23:06

MySql database, how to make a variable with individual value for all accounts?

Good evening.
There is a site with account management through a MySQL database. It is necessary to create the ability to change the variable on the site by the account id, so that it would be possible to change it for different users. If there is such an opportunity without interactions with the database, then I will also be glad to help. Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Akina, 2022-03-03
@Akina

Well, actually, a special service table is usually created for such purposes.

T
ThunderCat, 2022-03-03
@ThunderCat

What you are describing so strangely, if I understand the essence correctly, is called ACL or RBAC, depending on the purpose and logic of the application.

R
rPman, 2022-03-03
@rPman

If for some reason you don’t want to create a table for data,
then you can use a view or a stored procedure in which you literally write all the values ​​\u200b\u200bfrom the user (or any other conditions)

SELECT CASE
  WHEN USER() =='[email protected]' THEN 1
...
  ELSE 0
END

those. the storage place here will be the code of the stored procedure or view, and updating it will require a call to ddl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question