title: PHP Fatal error: Call to a member function row() on a non-object in
body: <p>can you please help me with my code i am new with php and codeigniter, i am trying to get the result of my query to the view but it's always an error occured "Fatal error: Call to a member function row() on a non-object in", iam trying to search a customer info by customer id and trying to get the result to the view itself</p>
  
  <p>this is view code</p>
  
  <pre><code> &lt;?php echo form_open('home/cari_id');
  ?&gt;
  &lt;table width='34%' align='left'&gt;
      &lt;tr&gt;
          &lt;td width="54%" align="left"&gt;ID Pelanggan&lt;/td&gt;
  
          &lt;td width="36%"&gt;
              &lt;?php echo form_input('id',set_value('id'));?&gt;
              &lt;?php echo form_error('id');?&gt;
          &lt;/td&gt;
          &lt;td width="10%"&gt;
              &lt;?php echo form_submit('submit','Cari');?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt; 
  
  &lt;br /&gt;&lt;br /&gt;
  
  &lt;table width="68%" align="left"&gt;
      &lt;tr&gt;
          &lt;td width="17%" align="left"&gt;Nama&lt;/td&gt;
          &lt;td&gt;
              &lt;?php   
                  $row = $record-&gt;row();
                  $nama1 = array(
                           'name' =&gt; 'nama',
                           'maxlength' =&gt; '100',
                           'size' =&gt; '50',
                           'style' =&gt; 'width:120%');
                  echo form_input($nama1,$row-&gt;nama);?&gt;
              &lt;?php echo form_error('nama');?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td align="left"&gt;Alamat&lt;/td&gt;
      &lt;td&gt;
          &lt;?php 
              $alamat1 = array(
                          'name' =&gt; 'alamat',
                          'rows' =&gt; '5',
                          'cols' =&gt; '3',
                          'style' =&gt; 'width:200%');
              echo form_textarea($alamat1,$row-&gt;alamat);?&gt;
          &lt;?php echo form_error('alamat');?&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="left"&gt;Golongan&lt;/td&gt;
          &lt;td width='29%'&gt;
              &lt;?php 
                  $gol1 = array(
                          'name' =&gt; 'gol',
                          'maxlength' =&gt; '100',
                          'size' =&gt; '50',
                          'style' =&gt; 'width:40%');
                  echo form_input($gol1,$row-&gt;golongan);?&gt;
              &lt;?php echo form_error('gol');?&gt;
          &lt;/td&gt;
          &lt;td width="10%" align="left"&gt;Tarif&lt;/td&gt;
          &lt;td width="44%"&gt;
              &lt;?php 
                  $tarif = array(
                  'name' =&gt; 'tarif',
                  'maxlength' =&gt; '100',
                  'size' =&gt; '50',
                  'style' =&gt; 'width:30%');
                  echo form_input($tarif,$row-&gt;tarif);?&gt;
              &lt;?php echo form_error('tarif');?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>here my code controller</p>
  
  <pre><code>public function cari_id()
  {
      $this-&gt;auth-&gt;restrict();
     // mencegah user mengakses menu yang tidak boleh ia buka
      $this-&gt;auth-&gt;cek_menu(4);
  
      $this-&gt;load-&gt;library('form_validation');
  
      $this-&gt;form_validation-&gt;set_rules('id', 'ID Pelanggan', 'trim|required');
      //$this-&gt;form_validation-&gt;set_rules('nama','Nama','trim'|'required');
      //$this-&gt;form_validation-&gt;set_rules('alamat','Alamat','trim'|'required');
      //$this-&gt;form_validation-&gt;set_rules('gol', 'Golongan', 'trim|required');
      //$this-&gt;form_validation-&gt;set_rules('tarif', 'Tarif', 'trim|required');
      $this-&gt;form_validation-&gt;set_error_delimiters(' &lt;span style="color:#FF0000"&gt;', '&lt;/span&gt;');
      $id_pel = $this-&gt;input-&gt;post('id') ;
      //$data1 = $this-&gt;usermodel-&gt;get_list_bayar_pel($id_pel);
      //$data=$data1-&gt;row();
      $data1 = $this-&gt;usermodel-&gt;get_list_bayar_pel($id_pel);
      $data['record'] = $query-&gt;result_array();
      $this-&gt;template-&gt;set('title','Input Pembayaran | POS Application');
      $this-&gt;template-&gt;load('template','admin/input_pembayaran',$data);
  
  }
  </code></pre>
  
  <p>and the model code</p>
  
  <pre><code>function get_list_bayar_pel($id)
  {
      $this-&gt;db-&gt;select('b.name as nama, b.address as alamat, c.nm_gol as golongan,d.rate_value as tarif');
      $this-&gt;db-&gt;from('account_t a, account_nameinfo_t b, golongan_t c, (select rate_value from rate_t a, golongan_t b where a.id_gol = b.id_gol) d');    
      $this-&gt;db-&gt;where('a.id_account = b.obj_id');
      $this-&gt;db-&gt;where('a.id_gol = c.id_gol');
      $this-&gt;db-&gt;where('a.id_account = "'.$id.'"');
      $result = $this-&gt;db-&gt;get();
      return $result;
      }
  </code></pre>
  
  <p>thanks before</p>