I am struggling to insert a combination of lat and lng into a point column in my database. I am trying the following, but i always get an error "cannot get geometry object from data you send to the GEOMETRY field.
I have tried:
$latlng = "geoPoint=GeomFromText('POINT(" . $latitude . " ". $longitude . ")'";
and also
$latlng = "POINT(" . $latitude . " ". $longitude . ")";
any advices? The following is the wpdb insert.
//db insert
$wpdb->insert(
'D4j7Qi13E_wpgmza', //Tabellenname
array( //daten
'map_id' => 1,
'address' => $formatted_address,
'description' => $descritbion,
'link' => $link,
'lat' => $latitude,
'lng' => $longitude,
'anim' => 0,
'title' => $title,
'infoopen' => 0,
'category' => $category,
'approved' => 1,
'retina' => 0,
'type' => 0,
'latlng' => $latlng
)
);
$wpdb->show_errors();
$wpdb->print_error();