Skip to content

Ds\Map do not support mysqli result fetch_object #79

@breath-co2

Description

@breath-co2
<?php
$mysql = new mysqli('localhost', 'root', '***', 'test');
$rs = $mysql->query('select * from `mydb` limit 10');
while ($row = $rs->fetch_object('\\Ds\\Map'))
{
    print_r($row);
}

output:

PHP Recoverable fatal error:  Object of class Ds\Map could not be converted to boolean in /test.php on line 4
<?php
$mysql = new mysqli('localhost', 'root', '***', 'test');
$rs = $mysql->query('select * from `mydb` limit 10');
while (null !== ($row = $rs->fetch_object('\\Ds\\Map')))
{
    print_r($row);
    var_dump($row->id);
    var_dump(isset($row['id']));
}

output:

Ds\Map Object
(
)
string(1) "1"
bool(false)
Ds\Map Object
(
)
string(1) "2"
bool(false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions