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});
?>
谢谢!首先为答案,然后为建议! –