row() and result() different

#1
[eluser]Unknown[/eluser]
what the diffent of of row() and result()?...
if i use row() data no showed...but if i use result() data is showed...
example :

Code:
$this->db->where('ID_PERKARA','1');                                $data_pasal_perkara=$this->db->get('td_kppu_pasal_perkara');
foreach ($data_pasal_perkara->result() as $dpp){
$dpp->PASAL;
}

and if i use row()
example :

Code:
$this->db->where('ID_PERKARA','1');                                $data_pasal_perkara=$this->db->get('td_kppu_pasal_perkara');
$dpp = $data_pasal_perkara->row();
$dpp->PASAL;
}
and show error like this

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: data_entry/pelaporan_lihat.php

Line Number: 55


#2
[eluser]Unknown[/eluser]
need help please....
thanks before...

#3
[eluser]InsiteFX[/eluser]
CodeIgniter Users Guide - Generating Query Results

That should clear it up.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.