Good afternoon all,
Well I have been programming in php for about a year now, and I am just now starting to understand the usefulness of a database as oppossed to keeping everything in $_SESSION or arrays.
I am in the process right now of creating an ordering system for a small photography studio that I work for, but am a little lost when it comes to the database structure. Here is my problem:
Each customer will have an account created once they have their first sitting at the studio. Upon logging in a list of available galleries is presented to them (Each gallery representing each different sitting they have had). They will select the gallery to view and then will be shown proofs of each picture in that gallery.
From there they will tell me how many picture of each size they want to order of each proof. As you can see I can getting into a lot of different variables here.
I want to be able to display purchase history by user and by order number, so here is where the problem stands.
Should I create all of the users purchase history inside one table of my current database, then figure out some way of sorting by user id. order number, proof number, and size until I get a useful account history.
Or should I create a second database called "orders" then for every customer create a table then try to make each order as it's own row?
Any guidance on this topic would be greatly appreciate since I am still learning how to do this.
The biggest problem is that each individual proof could have up to 20 different variables, and the number of proofs per order will change.. So I can't hard code anything except the print sizes available to order. Everything else has to be somewhat dynamic.
Thanks a ton in advance,
edwa5823
If you would like to see an example you can go to the following link: http://www.agmillerstudios.com/accounts/login.php
Use the name "php" and password "builder".. Follow the link that says "Order Test" and there you will see the options for ordering.