The while loop gets DB rows as such:
while($row = $result->fetch_assoc()){
$metadata_field74[] = $row['field74'];
$metadata_field75[] = $row['field75'];
$metadata_field76[] = $row['field76'];
$metadata_field77[] = $row['field77'];
}
Those rows are based on another DB table. Basically this loop should get the rows as based on another array of values received from a DB query.
Those values (field74, field75, etc) are stored in a array $metadata_id_basic[]. I get the values from that array like this and insert into the while loop:
while($row = $result->fetch_assoc()){
foreach ($metadata_id_basic as $value){
$ref = '$metadata_'.$value.'[] = $row[\''.$value.'\'];';
echo $ref;
}
}
However the array of rows is not seen. If I print $ref out it looks like:
$metadata_field74[] = $row['field74'];
$metadata_field75[] = $row['field75'];
$metadata_field76[] = $row['field76'];
$metadata_field77[] = $row['field77'];
So why does the while loop not read it correctly?