meisaputra Posted October 9, 2007 Share Posted October 9, 2007 dear freakers, i need to store php session in log table triggered by changes of the field. i have try to define it when create trigger. this is my code: ==== DELIMITER $$ DROP TRIGGER /*!50033 IF EXISTS */ `sample_audit`$$ CREATE TRIGGER `sample_audit` BEFORE UPDATE on `sampel_name` FOR EACH ROW BEGIN DECLARE mychanged INT DEFAULT 0; IF NEW.name != OLD.name THEN INSERT INTO sampel_name_audit SET fld_name = 'name', chg_by = '$_session[username]', oldval = OLD.name, newval = NEW.name; END IF; END$$ DELIMITER ; ==== the problem is, when i see the log table, column chg_by consist 0. it doesn't filled by $_session[username]. how to make it? thanks. rm Link to comment https://forums.phpfreaks.com/topic/72440-store-php-session-when-define-trigger/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.