I have several hundred records in client table (from my prev desktop program).I would like to add these entries in zzzzsys_user. Only some fields:
login, password, department. How can I do it programatically (not manual)? Is it possible?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Insert into zzzzsys_user from another table
-
- nuBuilder Team
- Posts: 4302
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Insert into zzzzsys_user from another table
You could also import a csv file with phpMyAdmin and create a trigger to generate a unique primary key and md5 hash the password, e.g. like
After the import, the trigger should be removed again so that there are no problems when users are created manually.
Code: Select all
CREATE TRIGGER insert_user
BEFORE INSERT ON zzzzsys_user
FOR EACH ROW SET
NEW.zzzzsys_user_id = Left(Replace(UUID(),'-',''),25),
NEW.sus_login_password = MD5(NEW.sus_login_password)