Okay! Well, it seems like my shopping cart, made using sessions, is finally working right. I can add various produts, modify them, and delete them. From the mycart.php page, I have a checkout button the user clicks to take them to the checkout.php page, which asks them for the typical, personal information.
At this point, because I'm not dealing with anything vitally important, such as credit cards, i was just going to do the whole thing in PHP. Thus, when a user fills that final form, and submits cart, I would code it to send me an email of the details.
One user gave a very nice advise; he mentioned that, although rare, my email servers could go down. And then what? That order would be lost.
So it does make sense to, at the very least, use the database somewhere in the ordering process. So for me, once the user fills the final, personal information form, I want to submit everything to a database. But how i do this is the question I need to ask. I know this is pretty broad and vague, so I'll try to clarify my situation.
I would obviously need a table in the database called "Orders", or something as such, that php will submit this data to. What would be the primary key of this table? Let's say that the primary key included the first and last name of the customer. But when they order more than one item, that won't work, as we will have two rows with duplicate keys. So then I include the item number as part of the key. In our type of trade, because of the individual personalization on each item, a customer could very well make more than one order of the same item. So at that point, should I make everything a primary key, just to avoid duplicates?
And how do I then get notified once this order is sent? How do I know that a customer just ordered something?
Thanks for your help.
Jonathan