in reply to hash or tables...

I'm gonna go for 'in the database'. Putting it in the script just seems 'wrong'. It's better to have all that sort of data in one place, from an overall point of view. Supposing you come back to the code a year later, or someone else attempts to understand it, and starts out by just looking at the database, you'll have a level_id in there that makes no sense.

After all, if its *never* going to change, you could just put the level name in the profiles table and have done with it. (Yes, thats a repition of data, but not much..) So, if its even 'slightly' likely its going to take place, its much better to have it in the database anyway, since in theory you can add to that without changing code.

Even if this is just a little script written for your use only, try to think a little more globally. Someday someone might ask for a script that does something like this, and you'll give it to them without thinking about it, so make it as easy to comprehend as possible, including for yourself several years later.

C.