开发者

insert tow $_post in a column of database?

开发者 https://www.devze.com 2023-04-01 00:49 出处:网络
how can tow input $_post insert in a column of database? \"first name=George\" and \"last name=Kurdahi\"

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

精彩评论

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