title: Syntax error defining MYSQL trigger
body: <p>I am using MYSQL Server version: 5.5.16 and having a very difficult time establishing my first trigger. Want to update a variable based on other values in a table whenever the table is updated. Following code produces syntax error ...#1193 - Unknown system variable 'status' </p>
  
  <pre><code>CREATE TABLE `peakstat` (
    `peakuid` int(11) NOT NULL AUTO_INCREMENT,
    `status` varchar(20)  ,
    `scheddate` date  ,
    `summitdate` date ,
  PRIMARY KEY (`peakuid`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
  </code></pre>
  
  <p>and establishing the trigger ...</p>
  
  <pre><code> delimiter $$
   drop TRIGGER if exists addstatus $$
   CREATE TRIGGER  addstatus 
   AFTER UPDATE ON  peakstat
     FOR EACH ROW
      BEGIN
           IF peakstat.summitdate &gt; 0 THEN
                set peakstat.status = "CLIMBED";
           ELSEIF peakstat.scheddate &gt; NOW() THEN
                set peakstat.status = "SCHEDULED";
           END IF;
      END;$$
   DELIMITER ;
  </code></pre>