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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.