Advertisement
Guest User

Untitled

a guest
May 29th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. SELECT * FROM wp_post_meta, (
  2. SELECT SQL_CALC_FOUND_ROWS wp_posts.* , gmwlocations.lat, gmwlocations.long, gmwlocations.address, gmwlocations.formatted_address, gmwlocations.phone, gmwlocations.fax, gmwlocations.email, gmwlocations.website, gmwlocations.map_icon, ROUND( 6371 * acos( cos( radians( \'42.2935977\' ) ) * cos( radians( gmwlocations.lat ) ) * cos( radians( gmwlocations.long ) - radians( \'12.220721899999944\' ) ) + sin( radians( \'42.2935977\' ) ) * sin( radians( gmwlocations.lat) ) ),1 ) AS distance FROM wp_posts INNER JOIN wp_places_locator gmwlocations ON wp_posts.ID = gmwlocations.post_id WHERE 1=1 AND wp_posts.ID NOT IN (0) AND wp_posts.post_type = \'hnmenuvogliadi\' AND ((wp_posts.post_status = \'publish\')) AND ( gmwlocations.lat != 0.000000 && gmwlocations.long != 0.000000 ) GROUP BY wp_posts.ID HAVING distance <= 50 OR distance IS NULL ORDER BY distance LIMIT 0, 8 ) AS a WHERE wp_post_meta.post_id = a.ID AND wp_post_meta.meta_value > 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement