MySQL::GetLastInsertID PHP 메소드

GetLastInsertID() 공개 메소드

Returns the last autonumber ID field from a previous INSERT query
public GetLastInsertID ( ) : integer
리턴 integer ID number from previous INSERT query
    public function GetLastInsertID()
    {
        return $this->last_insert_id;
    }

Usage Example

예제 #1
0
파일: Mysql.php 프로젝트: kimai/kimai
 /**
  * @param $data
  * @return bool|int
  */
 public function membership_role_create($data)
 {
     $values = array();
     foreach ($data as $key => $value) {
         if ($key == 'name') {
             $values[$key] = MySQL::SQLValue($value);
         } else {
             $values[$key] = MySQL::SQLValue($value, MySQL::SQLVALUE_NUMBER);
         }
     }
     $table = $this->kga['server_prefix'] . "membershipRoles";
     $result = $this->conn->InsertRow($table, $values);
     if (!$result) {
         $this->logLastError('membership_role_create');
         return false;
     }
     return $this->conn->GetLastInsertID();
 }
All Usage Examples Of MySQL::GetLastInsertID