Consider the following :
I have several arrays (let’s say 2), that I get with post, like that :
$_POST['date-pack'] :
$date_pack array {
[0] ==> "Juillet 2012"
[1] ==> "Avril 2012"
...
And with this array, I have another one with the id’s in the same order as the dates :
$_POST['id_pack'] :
$id_pack array {
[0] ==> "6"
[1] ==> "8"
...
The thing is, I want to update a table, like that :
"UPDATE my_table
SET date_service = *the_first_date_in_array*
WHERE id_service = *the first_id_in_array*"
and then do the same thing for all the elements in my arrays (they’ll have the same number of elements).
I don’t know if it’s possible to use “foreach” with several arrays and put my query into the loop … ?
Thanks in advance for your help !
Why not use something like: