diff --git a/www/class/centreon-clapi/centreonObject.class.php b/www/class/centreon-clapi/centreonObject.class.php index 1ac523da061..d052cbc4746 100644 --- a/www/class/centreon-clapi/centreonObject.class.php +++ b/www/class/centreon-clapi/centreonObject.class.php @@ -421,10 +421,8 @@ public function addAuditLog($actionType, $objId, $objName, $objValues = array()) $userId )); - $query = 'SELECT MAX(action_log_id) as action_log_id - FROM log_action - WHERE action_log_date = ?'; - $stmt = $dbstorage->query($query, array($time)); + $query = 'SELECT LAST_INSERT_ID() as action_log_id'; + $stmt = $dbstorage->query($query); $row = $stmt->fetch(); if (false === $row) { throw new CentreonClapiException("Error while inserting log action");