0

i have a recipe form of which ingredient, unit and quantity fields row can be added dynamically, I wanted to add these field into a single column named ingredient in database.

for now, the first row values is inserted in db as {"ingredients":["flour"],"quantity":["2"],"unit":["cup"]}

How can i insert the added row data too in this column? ingredient is the column where i want to insert these datas. Can you explain it with an example?

I know its the basic thing for you, but as a beginner its bit difficult for me to understand. Please help me out. Thank you!

Fathima
  • 3
  • 2
  • Not entirely sure what your question is about, so provided three duplicates. The first explains how to store json in mysql from mysql point of view, the 2nd explains how to save json data to database with laravel, the third explains the alternative to storing json in a column as storing json is at odds with relational database model. I would go with the third duplicate, if I were you. – Shadow Sep 29 '21 at 08:24
  • i want to insert each row data ( which is created dynamically by clicking add button) to the database on that particular column. – Fathima Sep 29 '21 at 08:29

0 Answers0