Modifed.
DROP FUNCTION IF EXISTS PersonName;
DELIMITER |;
CREATE FUNCTION PersonName( personID SMALLINT )
RETURNS CHAR(20)
BEGIN
DECLARE pname CHAR
I'm going to throw this in the mix because it may help other people with this issue.
If you are using phpMyAdmin, below the SQL entry box there is a delimiter box where you can type the delimiter to use for the query. You can put the outside delimiter here if you want to and then you don't need the delimiter directives.
For example, if you put the delimiter $$ inside the box you could use the following format for your query.
CREATE FUNCTION
blah blah...
END
$$
Some people may find this easier.