in a database products with various attributes are stored, eg
jersey in sizes Small, Medium, Large XLarge
wallet in Black, Blue, Red, Yellow
etc.

when displaying a product those attributes will be shown + a field for entering the desired quantity for purchasing it:


Code:
Jersey

Size     | Qty
Small    | [0]
Medium   | [0]
Large    | [0]
XLarge   | [0]
or
Code:
Wallet
 
Color    | Qty
Black    | [0]
Blue     | [0]
Red      | [0]
Yellow   | [0]
as said, both attributes (eg size or color) and the quantity are produced dynamically from the database.
Now if a user buys 2 Jerseys in Medium, ie types a 2 into the quantity input field of Medium and presses 'submit',
how do i know that the quantity of 2 refers to the medium jersey?