Welcome Guest, Not a member yet? Register   Sign In
Repeat 12 times the values that I show in a table.

I m generating one dynamic table with info from a DB, all goes perfect. But the problem is that if my table of DB has 20 records. When I generate the table it show many records. generally 6 to 12 times my real info..

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class MaincontentFunction extends CI_Controller
public function __construct()
  $this->load->model('content','', TRUE);
function index()
  $content = "";
  $query = $this->content->contenido();
  <table cellpadding='0' cellspacing='0' border='0' class='display' id='tableMainContent'>
      <th>Ultima modificacion</th>

  foreach($query->result() as $row)
   $data = array(
   'idfuncion' => $row->idfuncion,
   'descripcioncorta' => $row->descripcionCorta,
   'creadopor' => $row->creadopor,
   'fechacreacion' => $row->fechacreacion,
    <td>&lt;input name='opcion-res' type='radio' align='center'/&gt;&lt;/td>
Basically this is the controller that allow me generate the dynamic table, I know that I'm not following exactly the MVC model But Right now I need it like this.

Please I need help..

This is basically for may to do a manager of downloads, If someone has a better Idea please let me know.
Many tahnks

It's likely an issue with your database query. Your controller looks fine; your foreach() loop won't duplicate results like that.

You forgot to close your table's HTML, by the way.

Theme © iAndrew 2016 - Forum software by © MyBB