![]() |
updateBatch(): Argument #2 ($index) must be of type string - 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: updateBatch(): Argument #2 ($index) must be of type string (/showthread.php?tid=90392) |
updateBatch(): Argument #2 ($index) must be of type string - ramonpuig - 03-11-2024 Hello! I am getting this exception : CodeIgniter\Database\BaseBuilder::updateBatch(): Argument #2 ($index) must be of type ?string, array given My code is this , its in a function inside my model. PHP Code: $db = $this->db; PHP Code: $data = [ Does not appear to show second argument as a String, but as an array. I am doing something wrong? Or is there a bug here? RE: updateBatch(): Argument #2 ($index) must be of type string - kenjis - 03-11-2024 Upgrade CI4. Quote:Since v4.3.0, the second parameter $index of updateBatch() has changed to $constraints. It now accepts types array, string, or RawSql. RE: updateBatch(): Argument #2 ($index) must be of type string - ramonpuig - 03-12-2024 (03-11-2024, 05:40 PM)kenjis Wrote: Upgrade CI4. i updated to 4.4.6 and i will test but i cant get any further until i solve another bug that has appeared after the update, not happening before the update. Code: public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) (03-12-2024, 04:34 AM)ramonpuig Wrote:(03-11-2024, 05:40 PM)kenjis Wrote: Upgrade CI4. I was able to solve the issue by adding the session.php to the App/Config folder , i had not checked this was a requirement in the upgrade! RE: updateBatch(): Argument #2 ($index) must be of type string - kenjis - 03-12-2024 See https://codeigniter4.github.io/CodeIgniter4/installation/upgrading.html |