title: Error in create function syntax developed with MySql not working in MariaDB on PhpMyAdmin SQL console
body: <p>I have the following <em><strong>create function</strong></em> block for SQL</p>
  <pre><code>/**
   * tos_get_duration.sql
   *
   * Given time unit in seconds, it converts to more readable format
   *
   * Eg. SELECT TOS_GET_DURATION(72) =&gt; 00d 0:1:12
   */
  
  DROP FUNCTION IF EXISTS TOS_GET_DURATION;
  DELIMITER $$
  CREATE FUNCTION TOS_GET_DURATION(seconds INT) 
    RETURNS VARCHAR(16) 
  BEGIN
    RETURN CONCAT(LPAD(FLOOR(HOUR(SEC_TO_TIME(seconds)) / 24), 2, 0), ' days ',TIME_FORMAT(SEC_TO_TIME(seconds % (24 * 3600)), '%H:%i:%s'));
  END; 
  $$
  DELIMITER;
  </code></pre>
  <p>it is taken from <a href="https://github.com/saleemkce/timeonsite_analytics/blob/master/tos_get_duration.sql" rel="nofollow noreferrer">timeonsite analytics reporting</a> query page.</p>
  <p>It used to be working well in MySql but I recently switched to MariaDB and tried executed this function; this function basically converts seconds to more human readable string format. I get following error:</p>
  <pre><code>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER' at line 1
  
  Server version: 10.5.16-MariaDB - MariaDB Server
  </code></pre>
  <p>Kindly help me find the issue and <strong>suggest me common &quot;create function&quot; format I can use in both</strong> MySql and MariaDB databases.</p>