Hi all
I'm looking to bounce my prob off someone else's head so I can figure it out quicker.. I know there's something I'm missing because I'm too close to it.
Here goes: my office has an internal inventory management database I designed in PHP & mysql. I'm working on a "shopping cart" type system right now so our people can order inventory online for their specific locations.
I've designed it so that all products ordered go into a cart which then has to be approved by a manager before submitted to order personnel. All these orders in the cart go into the same table in a db... once it is submitted by the manager it gets moved from the cart table to the orders db..
We have 2 week ordering periods where everything ordered within that period isn't submitted until the end of week 2... so I've datestamped all orders made within the specific time period so it differentiates carts. I also have all entries in the carts and orders db have a key telling me which location the entry goes to. So there are two keys in essence: datestamp and location.
My problem is on my shopping cart when a user clicks on their cart there may be items in the cart from multiple datestamps... I want to sort it so if there are items from multiple datestamps, it presents the user with a dialog asking them to choose the datestamp they want to view the cart from.
This is becoming problematic. I query the db for all entries in the carts table that matches the specific location of the user that is logged in, but then sorting them by datestamp is difficult. I can't query for both location and datestamp at first because I don't know the datestamp until I do the initial query, and then I know datestamps of each individual product but they are all isolated inside of a foreach() statement so I can't figure out how to compare them to each other without doing odd things with arrays, anyway it's a mess.
Anyone up to helping me with this...?

