title: PHP Error - Cannot use a scalar value as an array
body: <p>Hello I am a beginner in codeigniter framework and I have some problems.</p>
  
  <p>On my index page i have login form, and when user insert username and password and clicks submit button he calls controller's method login whose task is to collect username and password from form and to pass the data to models method "login($username, $password)" and then models method returns true or false depending on whether we have valid user in database or not, and then controller's method either  pass the user further or returns him on the beginning.
  My problem is that i want to know users access level, and i made this method in model </p>
  
  <pre><code>public function users_level($username){
  
      $query = $this-&gt;db-&gt;get_where('users',array('username' =&gt; $username) );
  
      $users_level = $query-&gt;result();    // I tried with these too $users_level[] = $query-&gt;result();    
  
      return $users_level;
  }
  </code></pre>
  
  <p>with which i want to return user's access level, and to use that information in order to determine what view to present for that specific user.</p>
  
  <p>This is login method from controller:</p>
  
  <pre><code>public function login(){
          $username = $this-&gt;input-&gt;post('username');
          $password = $this-&gt;input-&gt;post('password');
  
          $this-&gt;load-&gt;model('model_user');
          $result = $this-&gt;model_user-&gt;login($username,$password);
          if ($result == true){     
                  $result['level'] = $this-&gt;model_user-&gt;users_level($username);    //i believe that mistake is maybe in this line
                  $this-&gt;welcome();   //I'm going to send information to welcome method about users level of access                  
              }else if ($result == false){
                  $this-&gt;index();
              }
  }
  </code></pre>
  
  <p>And this is an error that occurs</p>
  
  <pre><code>Severity: Warning
  
  Message: Cannot use a scalar value as an array
  
  Filename: controllers/controler_user.php
  
  Line Number: 33
  
  Backtrace:
  
  File: C:\wamp\www\ci_project_2015\application\controllers\controler_user.php
  Line: 33
  Function: _error_handler
  
  File: C:\wamp\www\ci_project_2015\index.php
  Line: 292
  Function: require_once
  </code></pre>