In a form within a sqlsrv_fetch_array I have
<select class="styled-select" name="StockArray['.$row1['ProductID'].']" required><option selected></option><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option></select>
and on the page after submitting that form I have this foreach to construct an insert.
$InsertDate = date("Y-m-d H:i:s");
foreach ($_POST['StockArray'] as $ProductID => $Qty) {$InsertList .= "('".$ProductID."', '".$Qty."', '".$InsertDate."', '1'),";}
$InsertList = rtrim($InsertList, ',');
What I would like to pass is an extra variable within $_POST['StockArray'] called $row1['LastQty'] so I can add an additional column in my insert. I don't think that is technically possible for an array to have more than just one value per key but I'm here to see if there is a workaround for that for what I'm trying to do.