Im trying to create an array from a variable name. I want to get the information from an sql table and hold that information in an array, however I get an error saying "cannot use [] for reading". Why?
<?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});
?>