mysql - How to connect two tables in phpmyadmin? -
i'm running wateranalyzer , want save sensor-data in mariadb. split data 2 tables: 1 automated part , 1 table stores data enter manually:
tables:
i'm having hard time (with basic knowledge databases) figure out how can "bind" id , datetime 1 table other one, if manual data added, id incremented 1 , actual date , time set in datetime.
i bet can somehow in phpmyadmin?
thanks time!
using triger. example you.
delimiter // create trigger contacts_after_insert after insert on contacts each row begin declare vuser varchar(50); -- find username of person performing insert table select user() vuser; -- insert record audit table insert contacts_audit ( contact_id, deleted_date, deleted_by) values ( new.contact_id, sysdate(), vuser ); end; // delimiter ;
Comments
Post a Comment