Click to See Complete Forum and Search --> : MySQL - Variable number columns


RAGEAngel9
03-30-2003, 07:18 PM
Ok that's a crappy subject, but I didn't know how to phrase it better.
Anyway I'm creating a database that will store user stats for a program I'm working on. I plan to store things like High Score, Avg. Score, Low Score, etc. What I wonder is since I'm using the average score is it possible to lengthen the number of fields as necessary so I can keep the average accurate? Or do I just need to guess a reasonalbe number and hope not many people go over with it?


Thanks


EDIT::
Also if I have a variable number of score columns, can MySQL determine which are null for a given row?

chrism01
03-31-2003, 02:33 PM
Not quite clear on the qn, but i'd say (assuming users are playing a game for example) you can either:
1. calc the avg each time in code, then update the row for that user, needing only one Avg col per user.
2. Have a row for each user for each time they play; Use a date col as part of the row key.