Skip to content

mysqli_query throws warning despite using silenced error mode #9841

Closed

Description

@kamil-tekiela

Description

The following code:

<?php

mysqli_report(MYSQLI_REPORT_OFF);
$mysqli = new mysqli('localhost', 'user', 'password', 'test');

$mysqli->query("SELECT (
        SELECT 1 AS val
        UNION ALL
        SELECT 2
    ) FROM dual");

Resulted in this output:

Warning: mysqli::query(): (21000/1242): Subquery returns more than 1 row in ...

But I expected this output instead:

PHP Version

PHP 8.0.20

Operating System

Windows and Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions