Skip to content

Support for insert() without an insert id #150

@scoman81

Description

@scoman81

I'm having a problem with inserting into this table:

CREATE TABLE `read_notices` (
  `ownerid` int(11) NOT NULL,
  `noticeid` int(11) NOT NULL,
  `read` datetime NOT NULL,
  KEY `IDX_MAIN` (`ownerid`,`noticeid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

The reason is that unlike update(), insert() does not contain this line:

$this->count = $stmt->affected_rows;

Therefore, inserts without an insert id end up returning 0. For these inserts, checking count would suffice to know that the insert succeeded, if count were set.

Suggestion: please set count after an insert()

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions