Trying to use:
INSERT INTO table(fanDetLocZip, fanDetLocCity, fanDetLocState, fanDetLocLat, fanDetLocLong, fanDetLocTZ, fanDetLocDST) VALUES(00210, 'Portsmouth', 'NH', '43.005895', '-71.013202', -5, 1);
I’m currently using the datatype
Its giving me errors like:
Cannot get geometry object from data you send to the GEOMETRY field
All the values have 2 digits, and 6 decimal places after decimal. How do I store this in mysql?
Error I get when I use:
INSERT INTO Table(fanDetLocZip, fanDetLocCity, fanDetLocState, fanDetLocLatLong, fanDetLocTZ, fanDetLocDST)
VALUES(00210, 'Portsmouth', 'NH', point(43.005895,-71.013202), -5,1)
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
You can use
POINT() to store into a column of type
If the Geometry column is named
geom, you can use this:
INSERT INTO table ( ..., geom, ...) VALUES ( ..., POINT(43.005895, -71.013202), ...)
If you want to show data stored, you can use the
SELECT X(geom) AS x, Y(geom) AS y FROM table
Why dont you use instead a Float type for your lat/long?