PHP, MySQL, Google Maps Questions
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 开发者_如何学JAVAXML 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?
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
精彩评论