I am building this tool for emergency care at events, and I am stuck in a problem. I have this map, and there are zones marked for a certain team to intervene if something happens in their area.
Now, when creating an intervention, it is possible to enter a coordinate on the map (x,y). I want to find out how I can do this.
Zones for teams are not necessarily squares. I have them stored like this
x1,y1,x2,y2,x3,y3,x#,y#.
What do you think would be best practice?
- Adding 4 fields, start_x, end_x, start_y and end_y and then do a SELECT * FROM tble WHERE coord_x BETWEEN start_x AND end_x query to get the X side, and same for the Y side.
- Do the same like above, but instead of adding fields, just do this in PHP code, run through every team area
- Your solution?
Thanks in advance :)