I am trying to store the Latitude and longitude values in Mysql Geomfromtext Point format using yii2 insert query.
$column_name->NORTHING_EASTING = POINT(43.005895,-71.013202);
But it is not working.It throws some error.I dont know how to store the coordinates in mysql in point format.My field datatype is POINT(Geomfromtext).I am trying this for the past 7 days,bt i din get any idea.Pls help me out if anybody have an idea to solve this.Thanks in advance!!
I am storing the values in database as follows:
I tried using the above code.But i am not getting the correct result.So i used simple code to solve this.
$connection = \Yii::$app->db;
$command = $connection->createCommand('INSER INTO tbl_name(NORTHING_EASTING) VALUES(POINT(43.005895,-71.013202))');
$command->execute();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With