I have a form where a user submits his member name, first and last. I want to combine these two and send them to the database as a member ID using code igniter’s url_title functionality. In other words just making sure that it’s all lower case, underscores, URL safe, etc. This is the code in my model, but in the database I’m getting a value of zero for the memberID:
$v_membername = $this->input->post('f_membername');
$v_memberlast = $this->input->post('f_memberlast');
$v_memberid = $v_membername + "_" + $v_memberlast;
$v_memberid = url_title($v_memberid, 'underscore');
$data = array(
'member_name' => $v_membername,
'member_last' => $v_memberlast,
'member_id' => $v_memberid
);
$this->db->insert('members', $data);
Any idea what I’m doing wrong here? membername and memberlast submit to the DB just fine.
PHP uses
.to concat strings, not+.