title: Can't Create MySQL TRIGGER when i use IS NOT NULL
body: <pre><code>CREATE TRIGGER b_I_O AFTER UPDATE ON book
  FOR EACH ROW
  BEGIN
  IF (OLD.status IS NOT NULL AND NEW.status IS NOT NULL AND NEW.status != OLD.status ) THEN
      INSERT INTO book_in_out (astatus, bid, time) VALUES(NEW.status, OLD.id, NOW());
  END IF;
  END;
  </code></pre>
  
  <p>First post here after hours of searching.</p>
  
  <p>I'm trying to insert into book_in_out using trigger after updating booking table, I was able to do this but if I update <code>bookName</code> the trigger will try to run.</p>
  
  <p>I only want the trigger to run only when status column changes. default value for <code>status</code> column is <code>NULL</code></p>
  
  <p>Below is the error i keep getting:</p>
  
  <pre><code>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
  </code></pre>