有一个要求是不能用double类型,float类型也不能用。那么在mysql中使用什么样的类型存储经纬度比较合适呢?
如果要存为varchar类型,php中两者该如何转换呢?如果存为int类型,是否要使用bigint,还是说int就能满足呢?
学习是最好的投资!
You can use string varchar, and then convert the string into double type or float type
varchar
double
float
Mysql supports the Geometry type, but it is more troublesome to operate.
Just convert it to plastic storage. If the accuracy is required to be 8 decimal places, multiply it by 10^8 and store it in the database
You can use string
after taking out the datavarchar
, and then convert the string intodouble
type orfloat
typeMysql supports the Geometry type, but it is more troublesome to operate.
Just convert it to plastic storage. If the accuracy is required to be 8 decimal places, multiply it by 10^8 and store it in the database