title: Database Queries without Model Objects on CodeIgniter
body: <p>Can I actually make database queries without creating a new instance of the model?</p>
  
  <p>For example, in my controller I have (CONTROLLER)</p>
  
  <pre><code>Name_Model::get_all_from_another_table();
  </code></pre>
  
  <p>and in my name_model.php (MODEL)</p>
  
  <pre><code>public static function get_all_from_another_table() {
      $this-&gt;db-&gt;query('select * from another_table');
      return $x;
  }
  </code></pre>
  
  <p>This case happens for tables with predefined values to be loaded before creating new instances of model.</p>
  
  <p>The above code returns:</p>
  
  <pre><code>Fatal error: Using $this when not in object context
  </code></pre>