本地执行无错,服务器上就提示
错误
SQL 查询: CREATE FUNCTION `location` (`ip` int unsigned
) RETURNS varchar( 100 ) CHARSET gbk BEGIN declare c varchar( 100 ) ;MySQL 返回: #1064 - 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 3 

我想知道,到底哪里错了?是服务器端mysql版本问题?CREATE FUNCTION `location`(`ip` int unsigned) RETURNS varchar(100) CHARSET gbk
BEGIN
declare c varchar(100);
set c = (select location from chunzhenip where ip<end order by ip limit 1);
RETURN c;
END