views:

31

answers:

1

How would you save the quote products in a database? Serialize data?

http://cl.ly/6419969e30cd26e2f32a

They can create however many rows they want... It's for a quote system. Create a quote with however many products. I need to save X Product At X Qty and X Price foreach one.

Serialize in the only thing I could come up with, but I hate unserializing so very much. I didn't know if there was a quicker/more efficient way.

I also have all this information to store with / link with it http://cl.ly/40cc9fea47932b3740b2

PHP (Kohana) > mySQL

Thanks for any input you may have.

+1  A: 

I would split the items on a quote into a separate child table:

Quote           QuoteItem        Item
=========       ===========      ============
QuoteID         QuoteID          ItemID
Subject         ItemID           Description      
ValidUntil      Quantity         Cost
Address         Price

Create one entry in the quote table, and then for each item on that quote create an entry in the QuoteItem table with the corresponding QuoteID.

BenV
I appreciate your input. That was my preferred route, however I wasn't sure that was most optimal... I'm thinking for my program layout that that would be the best option.
bradenkeith