Advertisement
demetriusPop

get column

Dec 14th, 2013
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if(isset($_POST['address']) && $_POST['address'] != '') {
  2. $user_search = esc_attr($_POST['address']);
  3.  
  4.  
  5. function get_address() {
  6. global $wpdb;
  7. global $user_search;
  8. $address_table = $wpdb->prefix . "address_table";
  9.  
  10. $query = $wpdb->get_col('SELECT json FROM ' . $address_table . 'WHERE address = ' . $user_search);
  11.  
  12.  
  13.  
  14.  
  15. $result = array();
  16. $result['lat'] = $query->results[0]->geometry->location->lat;
  17. $result['long'] = $query->results[0]->geometry->location->lng;
  18. return $result;
  19. }
  20. $latlong = get_address();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement