title: If else not working in phpmyadmin trigger
body: <p>So I was working with MySQL triggers in phpmyadmin. Here's my trigger for table scorm_track:</p>
  
  <pre><code>UPDATE userbatch 
  LEFT JOIN scorm_track 
  ON      
          (userbatch.user_id = scorm_track.userid)
  LEFT JOIN trainingobject
  ON      
          (scorm_track.tobjid = trainingobject.id)
  IF scorm_track.element = 'cmi.core.lesson_status' THEN
      SET userbatch.to_completion = scorm_track.value,
          userbatch.trainingcompleted = scorm_track.timemodified;
  ELSEIF scorm_track.element = 'cmi.core.score.raw' THEN
      SET userbatch.comment = scorm_track.value;
  ENDIF;
  WHERE (userbatch.batch_id = trainingobject.batchid) AND 
          scorm_track.id=NEW.id AND 
          scorm_track.element = 'cmi.core.lesson_status' OR scorm_track.element = 'cmi.core.score.raw'
  </code></pre>
  
  <p>But it shows the following error: "MySQL said #1064 - You have an error in your SQL syntax..."</p>
  
  <p>This problem started occurring after I added the IF ELSE statements. It was working fine before. Can anyone suggest why this maybe occuring?</p>