hwcasey12 Posted May 6, 2009 Share Posted May 6, 2009 PHP/MYSQL I am really struggling with how to setup a table (or two) in my database for an application at work. Example: My company sells training packages. A client will get a package of 30 sessions. Each week the trainer logs in and records their training for the week, deducting off each client's balance of sessions. The part of tracking total sessions purchased seems logical, but I can't figure out how to track sessions used, so that I can have a historical picture of the date it was used, but also total so I can deduct from their total purchased. Here is my thought, but I think it is weak :-\. TABLE: clientusedsessions ID - unique identifier DATE - date of session used (don't need time) INT - session used (so it is easy to total) Seems like a ton of tables if we have over 200 clients (and growing), which is fine, but I am guessing I am overlooking a simpler method. Thanks! ??? Quote Link to comment https://forums.phpfreaks.com/topic/157082-database-design-personal-training-sessions/ Share on other sites More sharing options...
Mchl Posted May 6, 2009 Share Posted May 6, 2009 Add clientID column to this table, so that you can store sessions for all clients in one table. Quote Link to comment https://forums.phpfreaks.com/topic/157082-database-design-personal-training-sessions/#findComment-827440 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.