Jump to content

Howardison

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    Ooohowardison

Profile Information

  • Gender
    Not Telling

Howardison's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I have this one question, I dont really know where to look for the answer. Hopefully this will help me. I have this mysql database, and i wanted to make a change to it. I have come up with 2 solutions, but i do not know which is better, what i mean by that is server and time efficiency. Solution one: Create a new table and add the current # of members to the new table. Each member will be identified by an Unique ID, therefore there will be one variable UNIQUEID, and there will be 900 rows, since there are 900 members in the whole database. But there are 32 other variables i want to add. Each variable represents a medal (medal_id), and each of them will have two other variables that goes along with it. awarded_by, and awarded_on So, In conclusion - There will be 1 UNIQUEID, 32 MEDAL IDS, 2 extra variables for each (64 variables).. and the total comes out to be 99 Variables in new table. But If there are 99 variables * it by 900 members, that will be over 89,000 cells in the database. $sql = @mysql_query(\"SELECT * FROM member_medals WHERE UNIQUEID = \"$UNIQUEID\"\"); $row = mysql_fetch_array($sql); extract($row); (Which takes less cpu time.) Solution two. Everything is same as above, except instead of 99 variables there will be only 4 variables. (UNIQUEID, medal_id, awarded_by, awarded_on) But since each row can ONly represent one medal, then 32 rows are needed to represent one member. But if im doin it this way, only the current active members will have a row to this table. At this current moment there are 240 members, and 1200+ medals given out, so only 1200+ rows. That is 4,800 cells. But if i do that way, the # of rows will increase alot faster than in solution one. $sql= @mysql_query(\"SELECT * FROM member_medals WHERE UNIQUEID = \"$UNIQUEID\"\"); while($row = mysql_fetch_array($sql)) { extract($row); } IN CONCLUSION- If let say i will use it for a long time and the databae will get bigger, in the long term what is more effecient?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.