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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.