|
I'm new at Mysql, so forgive me if it's something simple. I'm am working in phpMyAdmin.
This is the code:
create function get_distance()
returns double
begin
declare latitude_1 float(10,6);
declare longitude_1 float(10,6);
declare latitude_2 float(10,6);
declare longitude_2 float(10,6);
select post_lat, post_long into latitude_1, longitude_1 from pc2 where post_uid = 10001;
select post_lat, post_long into latitude_2, longitude_2 from pc2 where post_uid = 10002;
return (((acos(sin((latitude_1*pi()/180)) *
sin((latitude_2*pi()/180))+cos((latitude_1*pi()/180)) *
cos((latitude_2*pi()/180)) * cos(((longitude_1-longitude_2)*
pi()/180))))*180/pi())*60*1.1515);
end get_distance;
And this is the error i get:
#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 4
PLEASE HELP!
|