title: What is the correct MySQL syntax for a Trigger with a conditional?
body: <p>Any help would be well received. :)</p>
  
  <p>Scenario: I have a MySql table 'artworkjobs_proudction'. I'm trying to create a trigger in PHPMyAdmin to set a date once certain fields in the table have met specific conditions. Since it is multiple conditions it seems like an IF conditional is the way to go. Below is the trigger:</p>
  
  <pre><code>CREATE TRIGGER `createProductionScheduleDate` 
  AFTER UPDATE ON `artworkjobs_production` 
  FOR EACH ROW 
  IF ((OLD.ArtworkStatus = 'Approved' OR NEW.ArtworkStatus = 'Approved')
    AND (OLD.isCompleted is NULL OR NEW.isCompleted is NULL)
    AND (OLD.isCompleted = 'N' OR NEW.isCompleted = 'N')
    AND (OLD.printDueDate &lt;&gt; '0000-00-00 00:00:00' OR NEW.printDueDate &lt;&gt; '0000-00-00 00:00:00')
    AND (length(OLD.invoiceNumber) &gt; 0) OR (length(NEW.invoiceNumber) &gt; 0)
    AND (OLD.importance &gt; 0) OR NEW.importance &gt; 0) AND (OLD.quantity &gt; 0 OR NEW.quantity &gt; 0) 
  THEN SET originalProductionDueDate = now()
  END IF;
  </code></pre>
  
  <p>The error I'm receiving is:</p>
  
  <blockquote>
    <p>One or more errors have occured while processing your request:
    The following query has failed: <em><code>&lt;SQL query as stated above&gt;</code></em></p>
    
    <p><strong>MySQL said: #1193 - Unknown system variable 
    'originalProductionDueDate'</strong></p>
  </blockquote>
  
  <p><code>originalProductionDueDate</code> is a correct field however. :(</p>
  
  <p><code>createProductionScheduleDate</code> is the name of the trigger, not of a table.
  The table is <code>artworkjobs_production</code>. Which I defined here: </p>
  
  <pre><code>CREATE TRIGGER createProductionScheduleDate 
         AFTER UPDATE ON artworkjobs_production
  </code></pre>