title: CodeIgniter database query into table class
body: <p>I am currently developing a module for ExpressionEngine and have a quick questions regarding outputting database queries into the table class.</p>
  
  <p>The only way I have managed to do this is via the following:</p>
  
  <pre><code>$this-&gt;EE=&amp; get_instance();
  $this-&gt;EE-&gt;load-&gt;library('table');
  
      $data = $this-&gt;EE-&gt;db-&gt;query("SELECT * FROM my_table");
  
      echo $this-&gt;EE-&gt;table-&gt;generate($data);
  </code></pre>
  
  <p>This is great, but I would like to input some additional options in the table such as "Duplicate" and "Delete". To do this I need to be able to out put the query results individually. I have attempted the following:</p>
  
  <pre><code>$this-&gt;EE=&amp; get_instance();
  $this-&gt;EE-&gt;load-&gt;library('table');
  
  $query = $this-&gt;EE-&gt;db-&gt;query("SELECT * FROM my_table");
  
  if ($query-&gt;num_rows() &gt; 0)
    {
      foreach($query-&gt;result_array() as $row)
          {
              $this-&gt;EE-&gt;table-&gt;add_row(
                  echo $row['id']."&lt;br /&gt;\n";
              );
          }
    }
  
  
  echo $this-&gt;EE-&gt;table-&gt;generate();
  </code></pre>
  
  <p>With the above I receive the following error "Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting '".</p>
  
  <p>Any assistance would be appreciated.</p>
  
  <p>Many thanks
  Ben</p>