Add procedure or function to database with PhpMyAdmin
Script before
/* Example script */
DROP PROCEDURE IF EXISTS calculateLength $$
CREATE PROCEDURE calculateLength ()
BEGIN
SELECT value FROM `table` WHERE 1=1
END;
/* End script */
Solution
- Go to any SQL tab in phpMyAdmin.
- Directly below the SQL text area you’ll see a text input labeled “Delimiter.” In that field, enter “$$”.
- I can then paste in this slightly-modifed SQL script. Notice, I’ve removed the DELIMITER statements. phpMyAdmin handles that for me.
/* Example script */
DROP PROCEDURE IF EXISTS calculateLength $$
CREATE PROCEDUREĀ calculateLength ()
BEGIN
SELECT value FROM `table` WHERE 1=1
END $$
/* End script */