As I mention in the title, I’m doing a request for latitude and longitude within a ‘bid_userloc’ table … but I need to combine information from the ‘wp_usermeta’ table …
SET @centerLat = '48.531157';
SET @centerLng = '-123.782959';
SELECT *, ( 3959 * acos( cos( radians( @centerLat ) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(@centerLng) ) + sin( radians( @centerLat ) ) * sin( radians( lat ) ) ) ) AS distance FROM bid_userloc HAVING distance < 25 ORDER BY distance LIMIT 0 , 20
And using the user_id that comes in from the SELECT *, I need to get some user data from the wp_userdata table that looks like this:
id
meta_key
meta_value
For example, I need the meta_value of meta_key “nickname” … as well as a number of others, but once I see how it’s done for one, I can add more.
I really appreciate it!
Try this, with distance replaced with what you originally had, and something else replaced with something real: