If I have this $_POST array:
session[1][0]=50&
session[1][1]=60&
session[2][0]=70&
session[3][0]=80
How can I use a for loop to get the value of the session and of the item? I thought this would work but it does not.
foreach ($_POST['session'] as $i => $value) {
$session = $session[$i];
$item = $value;
$query->bindValue(':session', $session, PDO::PARAM_INT);
$query->bindValue(':item', $value, PDO::PARAM_INT);
$query->execute();
}
So that the first iteration of the loop would produce $session=1 and $item=50?