Hello, I'm in the process of programming a customer area with a list of subscriptions :

Reference | Title | Type | Date of first subscription | Expires

Each item in this list will have a link to it's details with will show a list like this :

Subscribed on : date of first subscription
Renewed on : date of first renewal
Renewed on : date of second renewal
Renewed on : date of third renewal
Expires on : date when expires.

At the moment I have got three mysql tables :
------
1) Products

Reference | Title | Type

2) Subscriptions

number(autoincrement) | reference | date_begin

3) subscriptions details

number(autoincrement) | subscription_number | length(number of months)
------

To get the first table I would :

List subscriptions
For each subscription get list of "lengths" which I would add together and then calculate expire date by :
Total "lengths" + date_begin

Which gives me the expire date.

However all this seems alot of queries and resources for such a small list and as I have not started the programming yet and have not created the tables either, I thought I might ask your advice to see if you think this is the best way, or if you could think of a better way of achieving the same result. Maybe there is a way to get the expire date with mysql, or maybe I should rethink my tables?

I hope that everything is clear, and thanks in advance :)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to