I have a supermarket carton application where after the end of the sale needs to insert a record with data referring to that sale in a table, this record should include the code of the products bought and the quantity of each.
As I'm using a MySQL database there are no arrays, how should I proceed in a situation like this? Is there a good practice that can be applied to this case?
I had thought of doing the following, but I think this is a gambiarra:
codigo vendedor cod_produtos quant_produtos data
1 3 "1,5,3,6,9" "5,10,7,13,2" 12/12/2013
In case the fields cod_products and quant_products are of type char / varchar / nvarchar and if you need to get the data to generate a report or something would use something like string[] codigos = codProdutos.Split(',');
(in C #), to get the data in form of vector.