MongoDB
PHP Manual

MongoDB::lastError

(PECL mongo >=0.9.5)

MongoDB::lastErrorCheck if there was an error on the most recent db operation performed

Description

public array MongoDB::lastError ( void )

Parameters

This function has no parameters.

Return Values

Returns the error, if there was one, or NULL.


MongoDB
PHP Manual