[eluser]sumit270[/eluser]
Code:
$data = array(
'id' => $this->input->post('id'),
'title' => $this->input->post('title'),
'category' => $this->input->post('category'),
'body' => $this->input->post('body'),
'type' => $this->input->post('type'),
'location' => $this->input->post('location'),
'company' => $this->input->post('company'),
'url' => $this->input->post('url'),
'email' => $this->input->post('email'),
'ipaddress' => $this->input->ip_address(),
'posted' => time(),
'c_name' => $this->input->post('c_name'),
'c_phone' => $this->input->post('c_phone'),
'status' => $this->input->post('status')
);
how can i display the above with foreach array
Code:
if ($this->form_validation->run('jobs') == FALSE) {
$this->load->view('entavo/jobs_edit');
}else {
$data = array(
'id' => $this->input->post('id'),
'title' => $this->input->post('title'),
'category' => $this->input->post('category'),
'body' => $this->input->post('body'),
'type' => $this->input->post('type'),
'location' => $this->input->post('location'),
'company' => $this->input->post('company'),
'url' => $this->input->post('url'),
'email' => $this->input->post('email'),
'ipaddress' => $this->input->ip_address(),
'posted' => time(),
'c_name' => $this->input->post('c_name'),
'c_phone' => $this->input->post('c_phone'),
'status' => $this->input->post('status')
);
/*
foreach ($data as $key => $input) {
echo $key . " " . $input . "<br>";
}
print_r($data);
die();*/
$this->db->where('id', $this->input->post('id'));
$this->db->update('jobs', $data);
$redirect = 'entavo/jobs/details/'. $this->input->post('id');
redirect($redirect);
My full code looks like that, i want to eliminate the part in which i have to declare everything.