CodeIgniter Forums
Error: Show results from select on database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error: Show results from select on database (/showthread.php?tid=61062)



Error: Show results from select on database - El Forum - 09-10-2014

[eluser]Unknown[/eluser]
Hello,

I have received the newbie error

Quote:A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: resultados/jogo.php

Line Number: 82

The code error

Code:
<?php
       $data = array(
        'name'        => 'golsMandante',
        'value'       => $this->resultados->detalhes_por_id($id_jogo)->golsMandante,
        'maxlength'   => '2',
        'size'        => '2',
        'class'    => 'form-control',
        'style'    => 'width:60px'
        );
       echo form_input($data);
       ?>

Model 'resultados' function 'detalhes_por_id'

Code:
public function detalhes_por_id($id_jogo){

  $this->db->where('idJogo', $id_jogo);

  return $this->db->get('resultados')->result();
}



someone to help me?

thx


Error: Show results from select on database - El Forum - 09-10-2014

[eluser]Unknown[/eluser]
SOLVED!