hey guys i have a table in database and i want to retrieve data from it and display to view . . i have tried many methods but none of these working . . pls help . . this is my controller code:
function getname()
{
$this->load->model('user'); //load the user class
$data['member'] = $this->user->ar_getwhere();
$this->load->view('home_content_view', $data);
}
this is my model:
function ar_getwhere()
{
$this->db->select('');
$this->db->from('tbl_members');
$this->db->where('member_name',$this->input->post('member_name'));
$q = $this->db->get('');
if($q->num_rows() > 0)
{
$data = array();
foreach($q->result() as $row)
{
$data=$row;
}
return $data;
}
}
I don’t know what errors you’re experiencing but anyway
You are receiving post data in the model? You should receive post data in the controller and send it to the model, and then, catch its response… And you should send the whole response as well.