Welcome Guest, Not a member yet? Register   Sign In
Add table and fieldname
#1

Hi. im going to add database table and field and of course the field type,auto_increment and so on..  and  
may i ask what what is wrong with this?

PHP Code:
$tblname $this->input->post('tblname');
        
$fldname $this->input->post('fld_name[]');
        
                
$fldtype $this->input->post('fld_type');
                
$fldauth $this->input->post('fld_aut');
                
$fldlgth $this->input->post('fld_lgth');
                
        for(
$i 0$i count($fldname); $i++)    
            {
                
$insert = [[$fldname] => ['type' => $fldtype,
                            
'auto_increment' => $fldauth,
                            
'constraint' => $fldlgth,
                            
'null' =>TRUE]];
                
                
$this->dbforge->add_field($insert);
                
$this->dbforge->add_key($fldnameTRUE);
                
$this->dbforge->create_table($tblnameTRUE);
            } 

Thanks
Reply


Messages In This Thread
Add table and fieldname - by jaysondotp - 02-15-2019, 07:31 PM
RE: Add table and fieldname - by Wouter60 - 02-16-2019, 02:45 AM
RE: Add table and fieldname - by InsiteFX - 02-16-2019, 04:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB