CodeIgniter Forums
Rename a field with dbforge - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Rename a field with dbforge (/showthread.php?tid=67790)



Rename a field with dbforge - Wouter60 - 04-09-2017

I'm trying to rename a field, like this:
PHP Code:
$this->load->dbforge();
$fields = array(
    
'old_name' => array(
        
'name' => 'new_name',
        
'type' => 'VARCHAR'
    
)
);
$this->dbforge->modify_column('table'$fields); 
This gives an error message: MySQL syntax error on line 2, near ''
I can't see what I'm doing wrong here. Any help is appreciated.


RE: Rename a field with dbforge - InsiteFX - 04-11-2017

And what did the error say was wrong it shows the query part.