Welcome Guest, Not a member yet? Register   Sign In
Variables of single row in view
#1

[eluser]Fero[/eluser]
Hi,

This is my model function:
Code:
function nacitaj_produkt($id)
    {
      $query=$this->db->get_where('produkty',array('status'=>'1','id_produkty'=>$id));
      return $query->result();
    
    }

It loads one row of one product and returns it.

This is in one method of my controller:
Code:
$this->load->model('produkty_model');
      $product_data['product']=$this->produkty_model->nacitaj_produkt($id);
    
    $this->load->view('detail',$product_data);

in detail.php (view) I have no idea how to get those variables from database I got. echo $product->table_column; works only in loops in views, but it doens't work when there is only one row.


Messages In This Thread
Variables of single row in view - by El Forum - 02-18-2010, 11:53 AM
Variables of single row in view - by El Forum - 02-18-2010, 12:01 PM
Variables of single row in view - by El Forum - 02-18-2010, 12:25 PM
Variables of single row in view - by El Forum - 02-19-2010, 12:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB