⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

display records from a table using a loop



Roberto Fabian Rosero Diaz

Roberto Fabian Rosero Diaz
  • profile picture
  • Member

Posted 14 August 2013 - 20:33 PM

good afternoon to all of you
 
please help me with this problem:
 
in my controller I have the following query:
 
$this->db->select( 
             'df.id_proveedor, 
              df.id_estab, 
              df.no_factura, 
              df.generada, 
              df.vencimiento, 
              df.concepto, 
              df.descuento, 
              df.valor, 
              df.recibido, 
              df.fecha_elab, 
              dp.nom_dpto'); 
            $this->db->from('datos_factura df'); 
            $this->db->join('establecimientos es','df.id_estab = es.id'); 
            $this->db->join('ciudades ci','es.id_ciudad = ci.id_ciudad'); 
            $this->db->join('dptos dp','ci.id_dpto = dp.id_dpto'); 

            $query['sql']=$this->db->get();  

and sent him to the view in this way:

$this->load->view('facturas/FacturaView', $query);  

however, in the view I have a foreach loop, which is where I have to store the records that have the query, which put up, the foreach is this

foreach($sql as $row){ 
         .... 
         }  
 
precisely within that loop is the one to display the records in a table, that's what I'd like for you to please tell me:
 
How do I display records from that query in this loop?

 

 

sorry for the English, not speak English and use google translator

 

 

please help, it's greatly appreciate


davidoster

davidoster
  • profile picture
  • Member

Posted 15 August 2013 - 09:48 AM

Forgive us but this is a CodeIgniter question and not Grocery CRUD.

You need to check with the CodeIgniter community.

Also check the manuals and here.