diff --git a/makenestedarray.php b/makenestedarray.php index 0587d2b..e635050 100644 --- a/makenestedarray.php +++ b/makenestedarray.php @@ -57,7 +57,7 @@ function makerowdata($row,$model) { foreach($keys as $pos=>$key) { if($key != 'key' && $key != 'children') { // add key:value pair to "columns" array - $columns[$smodel[$key]] = $row[$key]; + $columns[$model[$key]] = $row[$key]; } } return $columns;