how can tow input $_post
insert in a column of database?
"first name=George" and "last name=Kurdahi"
开发者_运维百科
$data = array('name' => $this -> input -> post('first_name') && $this -> input -> post('last_name'))
$this -> db -> insert('submits', $data)
Output: George Kurdahi
if you wold like to insert "George Kurdahi" string to DB you should concatinate string with .
$data = array('name' => $this->input->post('first_name') . " " . $this->input->post('last_name'))
Or if you have 'name' and 'surname' fields in DB:
$data = array('name' => $this->input->post('first_name'), 'surname' => $this->input->post('last_name'))
精彩评论