Welcome Guest, Not a member yet? Register   Sign In
Are input->post arrays possible in codeigniter? I'm using doctrine and need to combine my birthday dropdown for db inser
#1

[eluser]psychonetics[/eluser]
I have just finished creating my signup form and now ready to insert data into the datebase using doctrine. Everything inserts fine but in my var_dump my birthday dropdown is in 3 seperates... day , month and year.. I would like to combine them and post as "birthday" into the db with doctrine.

Everything else inserts into the database correctly. Just need yyyy-mm-dd to insert now.

I wish to do this in my controller, please take a look at my code and you'll see where I want to place this code.

My code
Code:
public function submit() {

            $u = new User();
            $u->first_name = $this->input->post('first_name');
            $u->last_name = $this->input->post('first_name');
            $u->email = $this->input->post('email');
            $u->password = $this->input->post('password');
            //day
            //month
            //year
            $u->sex = $this->input->post('sex');
            $u->save();

            $this->load->view('submit_success'); // temporary account area page

}

}
#2

[eluser]CroNiX[/eluser]
Code:
$u->date = $this->input->post('year') . '-' . $this->input->post('month') . '-' . $this->input->post('day');
Something like that? Not exactly sure with the info posted.
#3

[eluser]psychonetics[/eluser]
Worked perfectly thanks

Code:
$u->birthday = $this->input->post('year') . '-' . $this->input->post('month') . '-' . $this->input->post('day');

This inserted what was selected in my form using the drop down date select into my db.




Theme © iAndrew 2016 - Forum software by © MyBB