dqwolwst50489 2014-10-02 05:13
浏览 66

在mysql表中存储区域单位转换[关闭]

I have land buy/sell related website. So I want to store land area units in India and their conversion in other in units in mysql table. When user from specific area see properties list on website and if he selects acre in dropdown list then he can see the every property area in the acre though the property was listed in another unit. So How Do I do this??

  • 写回答

1条回答 默认 最新

  • dtra49684 2014-10-02 06:06
    关注

    A simple two table can do this .. if you like..

    Table 1:Units[id,UnitName]
    Table 2:ConversionUnit[conversionId,fromUnitId,toUnitId,offset]
    

    such as

    table 1: [1,Centimetre],[2,Mitre],[3,kilometre]
    table 2: [1,1,2,100],[1,3,1,0.000001]
    

    First entry in the table to for converting CM to M and second row is to convert from KM to CM.

    Hope it helps..

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算