mysqli_report example


        $new_link     = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
        $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;

        if ( $this->use_mysqli ) {
            /* * Set the MySQLi error reporting off because WordPress handles its own. * This is due to the default value change from `MYSQLI_REPORT_OFF` * to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT` in PHP 8.1. */
            mysqli_report( MYSQLI_REPORT_OFF );

            $this->dbh = mysqli_init();

            $host    = $this->dbhost;
            $port    = null;
            $socket  = null;
            $is_ipv6 = false;

            $host_data = $this->parse_db_host( $this->dbhost );
            if ( $host_data ) {
                list( $host$port$socket$is_ipv6 ) = $host_data;
            }
$port     = null;
            $socket   = $this->hostname;
        } else {
            $hostname = ($persistent === true) ? 'p:' . $this->hostname : $this->hostname;
            $port     = empty($this->port) ? null : $this->port;
            $socket   = '';
        }

        $clientFlags  = ($this->compress === true) ? MYSQLI_CLIENT_COMPRESS : 0;
        $this->mysqli = mysqli_init();

        mysqli_report(MYSQLI_REPORT_ALL & ~MYSQLI_REPORT_INDEX);

        $this->mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 10);

        if ($this->numberNative === true) {
            $this->mysqli->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);
        }

        if (isset($this->strictOn)) {
            if ($this->strictOn) {
                $this->mysqli->options(
                    MYSQLI_INIT_COMMAND,
                    
Home | Imprint | This part of the site doesn't use cookies.