Welcome Guest, Not a member yet? Register   Sign In
Cannot add or update a child row: a foreign key constraint fails
#10

I'm getting this error now:
Code:
CodeIgniter\Events\Events::Config\{closure}(): Argument #1 ($query) must be of type Config\Query, CodeIgniter\Database\Query given

This is my events.php:
PHP Code:
<?php

namespace Config;

use 
CodeIgniter\Events\Events;
use 
CodeIgniter\Exceptions\FrameworkException;

Events::on('pre_system', static function () {
    if (ENVIRONMENT !== 'testing') {
        if (ini_get('zlib.output_compression')) {
            throw FrameworkException::forEnabledZlibOutputCompression();
        }

        while (ob_get_level() > 0) {
            ob_end_flush();
        }

        ob_start(static function ($buffer) {
            return $buffer;
        });
    }

    if (CI_DEBUG && ! is_cli()) {
        Events::on('DBQuery''CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
        Services::toolbar()->respond();
    }
});
Events::on(
    'DBQuery',
    static function (Query $query) { log_message('alert', (string) $query); }
); 
Reply


Messages In This Thread
RE: Cannot add or update a child row: a foreign key constraint fails - by Sincere - 06-14-2022, 06:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB