Welcome Guest, Not a member yet? Register   Sign In
foreach help needed!!
#1

[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.


Messages In This Thread
foreach help needed!! - by El Forum - 06-23-2010, 06:08 PM
foreach help needed!! - by El Forum - 06-23-2010, 07:45 PM
foreach help needed!! - by El Forum - 06-23-2010, 07:57 PM
foreach help needed!! - by El Forum - 06-23-2010, 08:01 PM
foreach help needed!! - by El Forum - 06-23-2010, 08:13 PM
foreach help needed!! - by El Forum - 06-23-2010, 08:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB