1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Rep Power
    Hi I'm writing a weather web site using PHP/MYSQL.

    My table has parameters like day, max, min, weather. These parameters will change on a daily basis, BUT I also have parameters like
    lat(for latitude) and long (for longitude), plus a few other constants.

    So my question is, should I have a separate table called constants to store these values, then call them when needed?

    or would it be better to have them all in one table?

  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Perth West Australia
    Rep Power
    for what is still a relatively small table. having the constants will not affect performance much.

    Querying 2 tables will reduce performance , it doubles the time taken to access the DB which is the slowest part of the equation.

    Unless you have hunderds of constants, keep them in a .inc file, and then <? include("constants.inc");?> on any page that nees them.

    If you do keep everything in one table , just be frugal with your selects, and pull out only the data you need at any one time.

    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    I believe the simplest solution is to choose whatever you are more comfortable with...

    As far as performance is concerned, the one-table solution is more efficent. It'll save n processor cycles (n being the # of vars in the current table minus the # of constants -multiplied by some time constant of the processor, and a little extra for the time saved by not passing two seperate sets of data to any functions)

    ...But how much do we truely need that extra 0.000x seconds when the program's users are downloading at 56.6?


    ...I see firepages just wrote...I concur with firepages.

    [This message has been edited by snoop logy dogg (edited August 11, 2000).]

Similar Threads

  1. quick mysql/php question
    By mirthika in forum PHP Development
    Replies: 2
    Last Post: February 16th, 2004, 03:15 PM
  2. Quick regex wildcard question.
    By s200 in forum PHP Development
    Replies: 2
    Last Post: February 12th, 2004, 10:09 AM
  3. html tags in text boxes, quick question
    By poncenby in forum HTML Programming
    Replies: 1
    Last Post: February 4th, 2004, 06:31 PM
  4. Stupid performance question
    By avrfreak in forum PostgreSQL Help
    Replies: 3
    Last Post: December 16th, 2003, 03:44 AM
  5. quick question
    By muratisik in forum HTML Programming
    Replies: 7
    Last Post: December 4th, 2003, 08:59 AM

IMN logo majestic logo threadwatch logo seochat tools logo