Help Completing GPS MySQL StoreProcedure Select Statement(repost)

I need a MYSQL stored Procedure to take in 3 params:

CREATE PROCEDURE `distance`(IN mymsgid int,IN user_id int, IN mydistance float)


declare mylon double;

declare mylat double;

SELECT latitude, longitude into mylat, mylon from USER WHERE id = user_id;

SELECT id, ( 6371 * acos( cos( radians(mylat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(mylon) ) + sin( radians(mylat) ) * sin( radians( latitude ) ) ) ) AS distance

FROM USER HAVING distance < mydistance ORDER BY distance LIMIT 0 , 20;


The code above returns ID and distance, but I need data from two tables joined by userid and msgid > mymsgid

I have two tables I need joined that has a distance of myDistance. I will forward all the schemas once bidder is selected.

Additional, if you have any GPS coordinate mysql experenice for faster queryies, if this is the best way to go. I do not plan on doing full table scans.

I will send over the schemas

Habilidades: Administração de Bancos de Dados, Linux, Instalação de Script, Shell Script, Arquitetura de software, UNIX

Ver mais: need linux help, i need gps, sin, sin cos, select, need gps, cos, mysql select statement, latitude longitude table, linux mysql create, mysql create table data, mysql help table, schemas, gps send, msgid, latitude longitude script, send gps data mysql, script latitude, 2010 procedure, mysql distance, mysql longitude latitude, distance table, mysql statement, send gps data table, code gps distance

Acerca do Empregador:
( 33 comentários ) United States

ID do Projeto: #2976044

Premiar a:


See private message.

$25.5 USD em 2 dias
(8 Avaliações)

3 freelancers are bidding on average $31 for this job


See private message.

$59.5 USD in 2 dias
(6 Comentários)

See private message.

$8.5 USD in 2 dias
(1 Comentário)