Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

combo box

$
0
0
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')        
        
);        
        
    


Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>