Skip to content

Issue with insert method not returning inserted row #45

@EmadAlmahdi

Description

@EmadAlmahdi

Hello,

I expected the fetch() method to return the inserted row, as the row is actually inserted into the database.
I am getting the output bool(false) instead of the inserted row.

$db = new Database([
    'type' => 'Mysql',
    'user' => 'root',
    'pass' => 'root',
    'host' => 'localhost',
    'db' => 'dt'
]);

$insertedRow = $db->insert('users_test1', ['name' => 'John Doe'], );
 
var_dump($insertedRow->fetch());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions