jimfog Posted July 5, 2013 Share Posted July 5, 2013 I am trying to achieve something using a trigger but I do not know if it is even possible. The logic is this: Set a column value to NULL if an update is made where an empty string goes to the table column...this will be coming from an empty form input field. Thanks Link to comment Share on other sites More sharing options...
birbal Posted July 5, 2013 Share Posted July 5, 2013 Why not just verify the data in serverside language and if it is empty update column value with null? Link to comment Share on other sites More sharing options...
jimfog Posted July 5, 2013 Author Share Posted July 5, 2013 Why not just verify the data in serverside language and if it is empty update column value with null? I just want to learn triggers. Your idea, though, is not bad. What php code I could write to achieve what I mention above...I have already tried some but it did not work, something in the syntax was and that is why I am asking your help. Link to comment Share on other sites More sharing options...
davej Posted July 5, 2013 Share Posted July 5, 2013 One nice use for triggers is to create an audit trail table that records when other important edits were made. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now