Welcome Guest, Not a member yet? Register   Sign In
How to use attributes in controller or model?
#2

[eluser]Iciclefeet[/eluser]
Just looks like you got to defined $post_id that's all
Code:
$post_id=$this->input->post('id');
$data['cats'] = $this->clean_blue_model->cats($post_id);
Something like that.

If using Active Record Class
Can change your query to
Code:
public function cats($post_id = null) {  
  $qveri=$this->get_where('posts',array('id'=$post_id));
  if(!$qveri->num_rows())//No rows return
    return null;
  else
    return  $qveri->result_row();
}
Its the same thing but will add in the backticks


Messages In This Thread
How to use attributes in controller or model? - by El Forum - 04-16-2012, 06:43 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:34 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:41 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:44 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 08:20 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 10:44 AM
How to use attributes in controller or model? - by El Forum - 04-17-2012, 01:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB