0
林創建陣列試圖創建一個變量名的數組。我想從一個SQL表中的信息,並保持在一個數組的信息,但是我得到一個錯誤,說「不能用[]閱讀」。爲什麼?從變量名
<?php
// SQL Selection CurrentProduct Attributes
$sql = "SELECT * FROM $current_product_name";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
${current_product_name ._array[]} = $row; // add the row in to the array
}
${current_product_name ._length} = count({$current_product_name . _array});
?>
謝謝!首先爲答案,然後爲建議! –