title: how to fix error in mysql code while making count trigger after insert
body: <p>i am setting triggerafter_inser and i dont know how to resolve it</p>
  
  <pre><code>DELIMITER $$
  USE `solocloud_dev_2`$$
  
  DROP TRIGGER IF EXISTS table_10_summary_after_insert $$
  
  CREATE TRIGGER table_10_summary_after_insert AFTER INSERT ON table_10
     FOR EACH ROW BEGIN
     DECLARE var INT;
     SET var=0;
  
     SELECT COUNT(*) FROM table_10_summary WHERE client_id = new.client_id;
  
     IF var &gt; 0
     THEN 
         UPDATE table_10_summary SET records = records+1 WHERE client_id = new.client_id;
  
      ELSE
          INSERT INTO table_10_summary (new.client_id,1);
  END$$
  
  DELIMITER$$
  </code></pre>