the order in which they got inserted, therefore you will know that the
first is the "start" and the last the "end". In order to search in
them ... it gets a bit complicated...
For solution A) I suggest having a
- TRIPS TABLE (HAS MANY POINTS) => columns => id, name, description,
notes, etc, etc
- POINTS TABLE (belongs to TRIP) => columns => id, trip_id, lat,
long, point_order
Dan
On Sep 25, 2:49 pm, midas <project.si...@gmail.com> wrote:
> I am creating an itinerary system where user will be able to record
> his trips, add one starting point where his journey begins, unknown
> number of stops on his way and finally one ending point. Now I am
> wondering how to create a meaningful database structure so one will be
> able to search every group of points: starting, trip stops and ending
> point.
>
> I am unsure how to model my database but I have two ideas I cannot
> decide between:
>
> A)
> Table TRIPS which will contain columns:
> start (one starting point)
> via (x trip stops)
> end (one ending point)
>
> OR
>
> B) (my preferred one) - one only column:
> waypoints
>
> My idea is to serialize array containing all trip points using
> json_encode() and save it into "waypoints" column in json format,
> because I have read it is quite faster than serialize() and I would be
> able to use it in my jquery scripts. What bothers me though is how can
> I search in those waypoints then? They will be mixed together - start,
> stops and end.
>
> What idea do you like most? Thanks for your comments guys.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment