redyard Posted September 6, 2007 Share Posted September 6, 2007 Hi all, I'm developing/designing a shopping cart with a flash front end and php/MySQL. The products information in the basket are stored in Objects which are stored in an array - so the information to be passed to the database is an array of objects and each object describes a product in the basket. The problem I have is how do I pass this array of objects to the database considering they will all be related to one customer. Is it possible to pass an array to php ? Any help in this area would be greatly appreicated. R Quote Link to comment https://forums.phpfreaks.com/topic/68230-passing-multi-items-to-database-shopping-cart/ Share on other sites More sharing options...
psylovibe Posted September 6, 2007 Share Posted September 6, 2007 i might be wrong cause Iam still new but i would create a a new table in mysql that holds basically user_id(buyer)| product_id now when the buyer adds to his cart you can add to the table. So lets say John has 3 diff items in his cart Jon | Ps3 Jon | Wii Jon | X360 then you can do like SELECT * from TABLE where user_id = Jon you can pass all that into an array and now you know what products he has. When he checks out u delete all the products from the table. This table will also be used at the same time with other users. Quote Link to comment https://forums.phpfreaks.com/topic/68230-passing-multi-items-to-database-shopping-cart/#findComment-343183 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.