The following code intends to cycle through a two dimensional representation of a database recordset and create an array for every column with the array name being the name of the column...
Code: Select all
foreach ($this->results as $row_n => $row) {
foreach ($row as $column => $value) {
$evalcode = '$this->' . strtolower($column) . "[$row_n]" . " = '$value';";
eval($evalcode);
}
}this code however works:
Code: Select all
$column = "hello";
$row_n = "3";
$value = "t";
$evalcode = '$this->' . strtolower($column) . "[$row_n]" . " = '$value';";
eval($evalcode);