B
B
buksttabu2016-03-17 22:11:07
MySQL
buksttabu, 2016-03-17 22:11:07

Triggers in Delphi?

Is it possible to use full triggers in Delphi using default tools? I have a database with logins and passwords for authentication + triggers for updating / changing the password in the table:

CREATE TRIGGER onHashUpdate 
 BEFORE UPDATE ON users 
 FOR EACH ROW BEGIN  
     SET NEW.password = md5(NEW.password); 
 END

CREATE TRIGGER onHashInsert  
 BEFORE INSERT ON users 
 FOR EACH ROW BEGIN  
     SET NEW.password = md5(NEW.password); 
 END

Accordingly, after modifying the data, the Users table should look like this:
872d42521383425fb241ab5866e920e8.PNG
To work with tables, I wrote a small form (I apologize in advance for the clumsy design):
0b939fa066534ba0bc3c6ea04dfcb24f.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2016-03-17
@deliro

Before you do this stupid thing, I will warn you: storing md5 from a password in 2016 is idiotic. Slightly less than keeping the password open.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question