Professional Web Applications Themes

Quite a dilemma... - MySQL

Hi everyone. I'm having some trouble with deciding how best to put the PHP timezones into a MySQL database. The database should server two purposes. Firstly, it should be able to list the continents, (Africa, Australia, Europe etc.)... I plan on having an Ajax interface, so that when Africa is clicked upon, any children are called from the server and displayed. If any of those children have children, then it will do the same again. I would like to make this system work with a fairly unlimited child-depth, so I decided to break the timezones up, give them IDs, and ...

  1. #1

    Default Quite a dilemma...

    Hi everyone.

    I'm having some trouble with deciding how best to put the PHP
    timezones into a MySQL database. The database should server two
    purposes. Firstly, it should be able to list the continents, (Africa,
    Australia, Europe etc.)... I plan on having an Ajax interface, so that
    when Africa is clicked upon, any children are called from the server
    and displayed. If any of those children have children, then it will do
    the same again. I would like to make this system work with a fairly
    unlimited child-depth, so I decided to break the timezones up, give
    them IDs, and also a field linking to the id of the parent (if there
    is one).

    Uh-oh... Major downfall. When the last child is clicked upon, I need
    to get the whole string for example: America/Kentucky/Louisville
    Kentucky being the parent of Louisville, and America being the parent
    of Kentucky. Drats. Well, I guess I can work with this if I knew for
    sure that there would be no more than a certain number of parents
    involved. Perhaps I can do this, but I can't think how I might do it
    without too many queries. The plus-side of doing it this way, would
    mean that it cuts down on data redundancy, which is why I like it, but
    it's really hard to get the data in the database the way it needs to
    be in a timely manner.

    I decided to see what I can do with just putting the whole string in
    which just an ID. OK, now I can get the whole string using an ID,
    which is quite useful, but I can't break it up into continents,
    countries/cites etc... Remember, the initial Web page should show only
    the continents, and then clicking on them will load their children,
    and clicking the children will load their's (if any) etc etc...
    Strewth! So The first method allows me to send that data how I want,
    and the second method allows me to retrieve the correct string by the
    appropriate ID.

    Do I really need two tables running here, or would someone please be
    able to suggest something?

    I hope my post makes sense. If it doesn't, please let me know and I'll
    be happy to clarify. I am pulling my hair out here, as a supposedly
    simple task keeps tackling me to the ground and kicking me whilst I'm
    down. Perhaps I shouldn't use a database, and I should just try and
    use PHP arrays?

    Many thanks in advance.

    Daz.

    Daz Guest

  2. Moderated Post

    Default Re: Quite a dilemma...

    Removed by Administrator
    subtenante Guest
    Moderated Post

  3. Moderated Post

    Default Re: Quite a dilemma...

    Removed by Administrator
    Daz Guest
    Moderated Post

  4. Moderated Post

    Default Re: Quite a dilemma...

    Removed by Administrator
    Jerry Guest
    Moderated Post

  5. Moderated Post

    Default Re: Quite a dilemma...

    Removed by Administrator
    Daz Guest
    Moderated Post

  6. #6

    Default Re: Quite a dilemma...



    Why not just use tables and keep the "history" in php? That is, you have a
    table for each content and then each of those tables has a tables for the
    different states, countries, counties, or whatever...


    But just "remember" in php the path that the user chose instead of trying to
    do that in sql. Should be a very simple thing to do.

    Jon


    Jon Guest

  7. #7

    Default Re: Quite a dilemma...

    "Perhaps I shouldn't use a database, and I should just try and
    use PHP arrays?"

    Why not? It would be quicker and its something that you only have to set up
    once. (you still have to enter the data by hand anyways, right?)

    By using php arrays or even sql you can convert to the other pretty easily
    so you can actually have both if you needed. I don't know anyting about the
    TZ/locale stuff but chances are someone has already done what you want and
    you can use it for free.


    Jon Guest

Similar Threads

  1. WSDL Dilemma
    By Demetri in forum ASP.NET Web Services
    Replies: 1
    Last Post: November 29th, 08:55 PM
  2. Digital SLR Dilemma
    By Ted in forum Photography
    Replies: 19
    Last Post: July 29th, 05:17 PM
  3. combo box dilemma
    By John in forum Microsoft Access
    Replies: 2
    Last Post: July 3rd, 06:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139