开发者

insert tow $_post in a column of database?

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'))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜