Hello,
Can anyone help me find the right code to input combo box through model?
I think I should change role input text into some other codes since it is a combo box that I am trying to input into the database.
PHP Code:
'role' => $this->input->post('email')
controllers/cpages.php
PHP Code:
public function addusers() {
$data['options'] = array(
'administrator' => 'Administrator',
'manager' => 'Manager',
);
$this->Mpages->add_user();
$this->load->view('addusers', $data);
}
views/addusers.php
PHP Code:
<tr>
<td>ROLE</td>
<td><?php echo form_dropdown('roles', $options, 'administrator'); ?></td>
</tr>
models/Mpages.php
PHP Code:
public function add_user()
{
$data = array(
'username' => $this->input->post('username'),
'email' => $this->input->post('email'),
'password' => $this->input->post('password'),
'role' => $this->input->post('email')
);
}
" If I looks more intelligence please increase my reputation."