Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Achievements

Name: Noko 2010-08-27 22:43

Alright, so I'm working on a site for a client. It is a bar, and the owner wants to be able to hand out 'achievements' that people can get at the bar that will show up on the website, and people can post to their Facebook. The actual process looks like this:

- She logs on to the admin area and hits the 'create achievement' button.

- She types in an ID for the achievement, a name, and a description. Then she enters in how many tickets for the site to generate.

- The code takes the information stores it, and generates a bunch of 9 digit codes that people can enter into the site to redeem.

-

It is a pretty simple system, but my question is this. What is the best way to store all of this in a MySQL database?

Right now I see two ways, both of which feel wrong.

First one:
----------------------------------------------------------
Unique ID :: Achievement ID :: Name :: Description :: Code
----------------------------------------------------------

In this, all the codes are stored in a single array which I then search and remove the code that is redeemed.

Second one:
----------------------------------------------------------
Unique ID :: Achievement ID
----------------------------------------------------------

In this, I store the name and description in the first two rows, then have one row for each ticket thereafter.

Any ideas on which method might be better? Or if there is a better one I'm too stupid to think of?

Thanks

Name: >>25 2010-08-29 13:36

dammit

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List