フォームから 2D 配列にデータを格納したいのですが、配列へのデータの挿入に問題があるようです。$orderArray[0][$count2] をエコーするとうまくいくようですが、$orderArray[1][$count2] をエコーするとエラーが発生します
$dateArray = array();
$orderArray = array(array());
$amountArray = array(array());
$count = 0;
$count2 = 0;
foreach ($_POST['export'] as $date){
$dateArray[$count] = $date;
include "/storescript/connect_to_mysql.php";
$sql = mysql_query("SELECT * FROM ordera WHERE orderDate = '$date' ORDER BY orderid ASC");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$orderArray[$count][$count2] = $row["orderAmount"];
$amountArray[$count][$count2] = $row["itemAmount"];
$count2++;
}
}
$count++;
}