jeudi 4 avril 2019

How Can I Save Multiple Check Box Value Into Different Rows In SQL Database By Laravel?

I have a form like image below :
1 I have Multiple Value with set_name(Numbers 1 2 3 ...) and set_value(0 OR 1).
This is my database table :
2

For example if i checked Number 1 And Number 2 And Number 6 and then clicked on save button .
At first check that is there a value with the name that i checked, in set_name in database or not, if there is a value(set_name) , update set_value of that to 1 else if there isn't any set_name and any row with that name , create a row with names Number 1,Number 2 and Number 6 then set their set_value to 1
How can i do this work with laravel?




Aucun commentaire:

Enregistrer un commentaire