I'm following some tutorials on mysql function creation but I keep getting the following error.
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 '' at line 5:
CREATE FUNCTION getstatisticscount (h VARCHAR(35),d date)
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE tel INT;
SELECT count(hash) into tel from statsitieken where hash=h and lastvisit between concat(d,' 00:00:00') and concat(d,' 23:59:59') group by hash;
RETURN tel;
END;
I can for my life not find where line 5 is, but no matter which line I put it on, I keep getting this error. If I remove this function from the sql fiddle code it's all fine. I can't find what's wrong with it... except maybe flawed tutorials.