未定义索引php mvc模型


Undefined index php mvc model

未定义索引:first_name

$view = $user->VIEW_EMP($connect);
    if (is_array($view)) {
        foreach($view as $key => $value){
            echo $view['first_name'];
        }
    }

功能:

static function VIEW_EMP($db){
    $sql = "SELECT * from employees LIMIT 0, 30 ";
    if($output = mysql_query($sql)):
            $columns = array();
            while($result = mysql_fetch_assoc($output)):
                $columns[] = $result;
            endwhile;
        endif; 
       return $columns;
    }

似乎打错了。

echo $view['first_name'];

应为

echo $value['first_name'];