title: Object of class Login_Model could not be converted to string
body: <blockquote>
    <p>Severity: 4096</p>
    
    <p>Message: Object of class Login_Model could not be converted to string</p>
    
    <p>Filename: models/login_model.php</p>
    
    <p>Line Number: 27</p>
  </blockquote>
  
  <pre><code>public function login() {
      //check user type
  
      $this-&gt;_table_name = 'tbl_employee_login';
      $this-&gt;_order_by = 'employee_login_id';
      $employee = $this-&gt;get_by(array(
          'email' =&gt; $this-&gt;input-&gt;post('email'),
           'password' =&gt; $this-&gt;$this-&gt;input-&gt;post('password'), LINE NUMBER 27
          'activate' =&gt; 1
      ), TRUE);
      /*employee*/
      $this-&gt;_table_name = 'driver';
      $this-&gt;_order_by = 'driver_id';
  
      $driver = $this-&gt;get_by(array(
          'email' =&gt; $this-&gt;input-&gt;post('email'),
          'password' =&gt; $this-&gt;$this-&gt;input-&gt;post('password'),
      ), TRUE);
      /*driver*/
      $this-&gt;_table_name = 'tbl_user';
      $this-&gt;_order_by = 'user_id';
  
      $admin = $this-&gt;get_by(array(
          'email' =&gt; $this-&gt;input-&gt;post('email'),
          'password' =&gt; $this-&gt;$this-&gt;input-&gt;post('password'),
              ), TRUE);
      if ($admin) {
          $data = array(
              'email' =&gt; $admin-&gt;email,
              'first_name' =&gt; $admin-&gt;first_name,
              'last_name' =&gt; $admin-&gt;last_name,
              'employee_id' =&gt; $admin-&gt;user_id,
              'loggedin' =&gt; TRUE,
              'user_type' =&gt; 1,
              'user_flag' =&gt; $admin-&gt;flag,
              'url' =&gt; 'admin/dashboard',
          );
          $this-&gt;session-&gt;set_userdata($data);
      } elseif($employee) {
  
          if (count($employee)) {
              // Log in user
              $employee_id = $employee-&gt;employee_id;
              $this-&gt;_table_name = "tbl_employee"; //table name
              $this-&gt;_order_by = "employee_id";
              $user_info = $this-&gt;get_by(array('employee_id' =&gt; $employee_id), TRUE);
  
              $data = array(
                  'email' =&gt; $employee-&gt;email,
                  'employee_id' =&gt; $employee-&gt;employee_id,
                  'user_name' =&gt; $user_info-&gt;first_name . '  ' . $user_info-&gt;last_name,
                  'employee_login_id' =&gt; $employee-&gt;employee_login_id,
                  'loggedin' =&gt; TRUE,
                  'user_type' =&gt; 2,
                  'url' =&gt; 'employee/dashboard',
              );
              $this-&gt;session-&gt;set_userdata($data);
          }
      }
      elseif($driver){
          $data = array(
              'email' =&gt; $driver-&gt;email,
              'drive_id' =&gt; $driver-&gt;driver_id,
              'name' =&gt; $driver-&gt;name,
              'loggedin' =&gt; TRUE,
              'user_type' =&gt; 3,
              'url' =&gt; 'driver/dashboard',
          );
          $this-&gt;session-&gt;set_userdata($data);
      }
  }
  </code></pre>
  
  <p>can any one give me a solution to solve this Error. i try to login using admin user name and password but it show me this and more error like string convert</p>