I wanted to add a header to my array before inserting it to my database. its for my auto-generate username function wherein usernames will go by the account type and followed by their account id
e.g
account type = student
account id = 20-1491-1243
so the username would be:
STUD20-1391-1243
these are my codes that i used for my model:
`***function add_student($data){
$insert = array(
'idno' =>$data['idno'],
'f_name' =>$data['f_name'],
'm_name' =>$data['m_name'],
'l_name' =>$data['l_name'],
'birth' =>$data['birth'],
'contact_number' =>$data['contact_number'],
'email' =>$data['email'],
'year' =>$data['year'],
'strand' =>$data['strand'],
'usertype' =>'student',
'username' => ['STUD']$data['idno'],
'password' =>'123456'
);
$this->db->insert('user',$insert);
}***`
everything else works, i just cant seem to add the STUD in the beginning of my usernames. right now thats an error because i included ['STUD'] before $data. I am at a complete loss.