title: To fetch fields requires the name of the table as a parameter
body: <p>I need to get the table structure of my database tables. SO i am using the below code. </p>
  
  <pre><code>class Some_model extends CI_Model{
  
      public $DB1;
      function __construct(){
          parent::__construct();
          $this-&gt;DB1 = $this-&gt;load-&gt;database('default',TRUE);
      }
  
      function getTableStructure($tableName){
          echo $tableName;     //this Outputs my table Name that i pass in the function
          return $this-&gt;DB1-&gt;field_data($tableName) ;   //this gives error for some tables
      }
  }
  </code></pre>
  
  <p>I get a Database Error </p>
  
  <p><em>To fetch fields requires the name of the table as a parameter.</em></p>
  
  <p><strong>Note :</strong> This function works on some tables but i get this error on few other tables.   Table i am checking on is "admin_user"</p>
  
  <p><strong>Update :</strong></p>
  
  <p>I have checked the field_data function in the DB_driver.php file in the system/database folder. </p>
  
  <p>when i print the return object i.e </p>
  
  <pre><code>echo "&lt;pre"&gt;;print_r($query-&gt;field_data());die();
  //return $query-&gt;field_data();   commented this line print's the object
  </code></pre>
  
  <p>However, </p>
  
  <pre><code>//echo "&lt;pre"&gt;;print_r($query-&gt;field_data());die();  comment this line shows error. 
  return $query-&gt;field_data();
  </code></pre>