MySQL INSERT/UPDATE on POINT column

后端 未结 2 1084
野的像风
野的像风 2021-02-06 04:03

I\'m trying to populate my DB with geographical places of my country. One of my tables have 4 fields: ID[PK], latitude. longitude ande geoPoint

EDIT `SCDBs`.`Pu         


        
相关标签:
2条回答
  • 2021-02-06 04:35

    You need to use this syntax:

    UPDATE ... SET latitude=18, longitute=-63, geoPoint=GeomFromText('POINT(18 -63)') WHERE ...
    
    0 讨论(0)
  • 2021-02-06 04:37

    Try doing it without assigning your values to server values. Especially if they contain function calls. MySQL treats the contents of the variables as plain text and won't see that there's a function call in there.

    UPDATE ... SET latitude=18, longitute=-63, geoPoint=POINT(18 -63) WHERE ...
    
    0 讨论(0)
提交回复
热议问题