Jump to content

Best way to store undetermined amount of product numbers


matthew798

Recommended Posts

Hey all,

 

Im just wondering what the best way to store a bunch of products numbers under a session id. I have a shopping cart that i want people to be able to add products to it. The product id numbers are around 4 digits each. Im just wondering what the most efficient way to store the cart is.

 

Create an individual table for each session ID and store the products there?

Create a table that stores each session ID and add the products in the same collumn then separae them when needed?

 

I cant think of any efficient sounding way to do this.

 

Heres some more info:

 

session_id = 0000001 (for example)

 

****************************

* SESS    *        PRODUCTS        *

****************************

*0000001* 1001,1002,1003,1004*

****************************

 

Thats what im thinking of doing now, but im worried about how im going to store carts that have 20 or more products, 20*4+20 commas, im looking at 100+ characters in one collumn... I dunno...  What do you guys think?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.