doushenxu7294 2010-10-16 05:58
浏览 22
已采纳

PHP,MySQL,谷歌地图问题

I'm attempting to build a web app and I've run into a bit of a wall. I'm not asking for anyone to hold my hand through making this, just some advice and a push in the right direction.

So, I'm trying to build an app that uses the Google Maps API to display a map of local parks near you and allow people to post pickup games (informal sporting events) for a specific time at a specific park. Simple enough right?

So far I've created a database with a table of local parks (columns: name, longitude, latitude) and a php script that takes that table and turns it into an XML file that the map uses to plot the points of the parks. I've also created a form that uses php to insert new data into the table and thus create a new park marker on the map.

This has all gone well so far but I'm just not sure how to proceed. I think I want to create a table 'games' (columns: sport, time, park(?)) but I'm not sure if that will work. Will I be able to setup a relationship between the 'parks' and 'games' table so that many games belong to a park? If so, how would I map those games? Does my thinking make sense?

  • 写回答

1条回答 默认 最新

  • douchen7366 2010-10-16 06:56
    关注

    If you'll create games table with sport_id | time | park_id columns, then game entity will be related to park entity by one-to-many relation. It means that one park handles 0..Many games and one game always belongs to one park.

    So, this is suitable solution for your issue. It fits your expectations.

    Additional info about relations: Cardinality

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题