Hey all i am in need of some help/advice on how to go about making this table for a project of mine.
It will be a coupon book database. The way the coupons are saved into the database is like this:
Code:
-----------------------------------------------------
| Level | CoupPic | ExpDate | QTY | Company | FunR |
-----------------------------------------------------
There are 3 levels to coupons. Basic, Silver, and Premium. Each will have a saved picture in the db how the coupon will look.
The Expdate is when the coupon will be voided (and deleted from the database).
The QTY is how many times the user is able to print out that particular coupon.
Company and FunR (fun raiser) are self explanatory.
Here is what the coupon db would look like populated with some data.
Code:
-------------------------------------------------------------------------
| Level | CoupPic | ExpDate | QTY | Company | FunR |
-------------------------------------------------------------------------
| Basic | (pic) | 02/22/09| 5 | Bobs | na |
| Premium| (pic) | 05/10/09| 10 |Tacobell | Little League baseball |
| Basic | (pic) | 10/02/09| 1 | temp2 | na |
| Basic | (pic) | 04/20/09| 7 | temp3 | something |
| Silver | (pic) | 12/20/09| 11 | temp3 | na |
There can be an unlimited amount of coupons per each level. Basic could have 100 coupons, Silver could have 150 and Premium could have 500.
Now for the users who will be getting these coupons. This is where i am having problems coming up with a solution. How would i be able to track how many times the user prints out a selected coupon from their purchased level if i do not know how many coupons will end up in the levels?
Here's what i am talking about
:
Code:
------------------------------
| Name | EmailAd | CoupLevel |
------------------------------
Say user BOB with an email address of
bob@here.com has level Basic. So lets say the Basic database houses about 50 company coupons.
Company A has a QTY of 5.
Company B has a QTY of 2.
Company C has a QTY of 10.
etc etc...
How can i keep track of each coupon in the level that the user prints out if the coupon db is unlimited on how many coupons enter and exit?
Hopefully i have explained it enough in order for you all to understand

If not, please feel free to ask more questions about it.
Thanks for your time,
David