Welcome Guest, Not a member yet? Register   Sign In
combo box
#1

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."
Reply


Messages In This Thread
combo box - by davy_yg - 08-08-2016, 08:28 AM
RE: combo box - by InsiteFX - 08-09-2016, 05:32 AM
RE: combo box - by davy_yg - 08-09-2016, 06:42 PM
RE: combo box - by davy_yg - 08-15-2016, 09:30 PM
RE: combo box - by PaulD - 08-16-2016, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB