I'm developping a website with a MySQL database containing 2 tables, one containing users information, a second containing gifts information. I want to store the information of who paid a part of the differents gifts and with which amount to give him the possibility to change it later.
I would add an entry to the gifts table with an array of users who donated and the amount. If someone want to change it later, I change the amount or remove the entry and update the displayed gift remaining amount.
But I do not think it is optimal to start with variable length arrays. Maybe creating a new table in the database with the donating user and amount for each gift would be better but it would also be more complicated to code and to manage (I would prefer to have only two tables).
Does someone have any suggestion regarding my dilemma?
EDIT: Based on @Lighthart suggestion I found a solution. I will create a table with a field for each gift. If a user donates for gifts, I create a new entry for the user and set an amount for the concerned gift field. If the user changes the amount, I update the entry. I can easily calculate the remaining amount by adding all the entries for one gift. If you have idea to still improve my solution, do not hesitate!