Is it possible to redeclare a MySQL function every time you refresh, this is my code
mysql_query("
DROP FUNCTION IF EXISTS Add_num;
CREATE FUNCTION Add_num(LAT_A INT)
RETURNS INT
READS SQL DATA
DETERMINISTIC
BEGIN
DECLARE Ans BIGINT;
SET Ans = LAT_A + 2;
RETURN Ans;
END");
even though I have the line DROP FUNCTION IF EXISTS Add2; the function stays the same when refreshing. For example I changed the 2 to 3 in the line SET Ans = LAT_A + 2; and then refreshed and it still adds 2 not 3.
I have written solution for you, but here I have used mysqli as you would be aware about mysql_query() doesn't accept semicolon(;) and can execute only one query at a time.
Code is as below :