Hi everyone. thanks u for u help
i’m working on a school project. I’m trying to save some data so let me explain
so for each exercice i have a mark.
there is a table for exercice to get the exercice name, and i want to save the mark of each exercice, in a table called mark_exercice which contain the id the the exercice and the mark of course. her is the code i did until now :
Nope. We don’t do school projects for people. We help to resolve specific problems. That means you need to put in some effort first, and when you hit a wall you show what you’ve done and explain how it’s not producing the desired result. You said you need to save with the ID of the exercise, I told you hidden inputs are the way to go. It’s up to you now to go and learn about hidden inputs, write some code, and if that doesn’t work, you show what you have and we help with that.
so when i do the debug for the request data i got for eash id of exercice a valu which is the mark, now how to split this request data so i can get the id of the exercice and the mark to get
saved
You’d want to use names like Marks[0][mark] for the checkboxes, and Marks[0][exercise_id] for the IDs. Increase 0 to 1 to 2, etc. for each exercise. Read about Cake’s field naming conventions for details.