/** * execute and get the last insert id * * @param string $sql statement (INSERT INTO ...) * * @return int the last insert id or false if there is an error */ protected function updateAndGetLastId($sql) { if ($inserted = $this->update($sql)) { $inserted = $this->da->lastInsertId(); } return $inserted; }