![]() |
forge->addColumn - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: forge->addColumn (/showthread.php?tid=92941) |
forge->addColumn - Chroma - 05-21-2025 Hi All, CI 4.6.1. I am trying to add a new column to an existing table. I am not having any luck. PHP Code: $val = array(); getEmailFields looks like PHP Code: protected function getEmailField() The error I am getting is an exception inside forge->addField. It seems that for some reason, it doesn't like the VARCHAR part of the definition. It throws a "Field information is required for that operation." exception, from line 387. The variable $val contains:
I don't see what I have done wrong and cannot find the error on the internet to track it down further. Any help is much appreciated. RE: forge->addColumn - grimpirate - 05-21-2025 I'm not understanding the majority of what your code does, but here is what it looks like in the simplest form to do what I think you're trying to achieve (try it and report back): PHP Code: $this->forge->addColumn('entry_requests', [ //'entry_requests' is the table name |