I want to get a number from POST and check it against the id column in my table and get the name of this row. In the following code outputting with print_r works, but each of the values I stored in the table order just with the value 0 (but in print_r values them not 0 and is same what i want) how can fix this problem? (i use codeigniter)
$query_cu = $this->db->get_where('info', array(
'id' => $this->input->post('number')
))->row();
$query_re = $this->db->get_where('info', array(
'id' => $this->input->post('recommend')
))->row();
$query_urf = $this->db->get_where('foreign', array(
'id' => $this->input->post('name')
))->row();
$data = array(
'name' => $query_urf->name,
'recommend' => $query_re->name,
'number' => $query_cu->name
);
$this->db->insert('order', $data);
echo '<pre>';
echo print_r($data1);