Skip to content
Advertisement

phpmyadmin how can i create a event like this?

I am creating an event on one of my databases to check if the client changed a specific parameter called ‘serverlog‘ which is a boolean on my Sql database.

Is there a way to loop through all the users in a table called ‘users‘, check if ‘serverlog‘ is false and update/set a different parameter called ‘islogged‘ in the user table. Something like a foreach user loop in SQL

I want to loop through all the users and if ‘serverlog‘ = false then set ‘islogged‘ = false on that user.

Advertisement

Answer

I want to loop through all the users and if ‘serverlog’ = false then set ‘islogged’ = false on that user.

UPDATE users_table
SET islogged = FALSE
WHERE NOT serverlog;
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement