title: Can not update data in Mysql
body: <p>I am trying to update data in Mysql or update if it exists but I get this error:</p>
  <blockquote>
  <p>#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 'delimiter;<br />
  call insertIfNotNull((SELECT checkin_id FROM `_9' at line 1</p>
  </blockquote>
  <p>This is the query I am using to update or insert data:</p>
  <pre><code>DROP FUNCTION IF EXISTS insertIfNotNull;                    
  delimiter $$                                        
  create function insertIfNotNull(checkin int(11))                     
  returns int                     
  BEGIN                         
     IF checkin IS NOT NULL THEN                              
        UPDATE `_914_table_checkin` SET clock_in = '2021-6-15 12:09:20', break_in = 'null', break_out = 'null', clock_out = '2021-6-15 12:09:41' WHERE checkin_id = checkin ;                        
     ELSE                             
        INSERT INTO `_914_table_checkin` (company_id, manager_id, worker_id, added_by, clock_in, break_in, break_out, clock_out, date) VALUES (4,214,225,'manager','2021-6-15 12:09:13','null','null','2021-6-15 12:09:34','2021-6-15');
     end if;
     return 2;                     
  END                    
  $$                    
  delimiter;
  call insertIfNotNull((SELECT checkin_id FROM `_914_table_checkin` WHERE company_id = 4 AND manager_id = 214 AND worker_id = 214 AND date = '2021-6-15'))
  </code></pre>