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});
?>
고맙습니다! 먼저 대답을위한 다음 제안을 위해! –