Jump to content


display records from a table using a loop

foreach query loop records

  • Please log in to reply
1 reply to this topic

#1 Roberto Fabian Rosero Diaz

Roberto Fabian Rosero Diaz

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 14 August 2013 - 08: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



#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

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.


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr






Also tagged with one or more of these keywords: foreach, query, loop, records

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users