function _insertid() { $sqlca = ifx_getsqlca($this->lastQuery); return @$sqlca["sqlerrd1"]; }
/** * Devuelve el ultimo id autonumerico generado en la BD * * @return int */ public function last_insert_id($table = '', $primary_key = '') { $sqlca = ifx_getsqlca($this->last_result_query); return $sqlca["sqlerrd1"]; }
/** * Devuelve el ultimo id autonumerico generado en la BD * * @return int */ public function last_insert_id($table = '', $primary_key = '') { if (!$this->id_connection) { return false; } $sqlca = ifx_getsqlca($this->last_result_query); return $sqlca["sqlerrd1"]; }
function GetSequenceNextValue($name, &$value) { if (!($result = $this->DoQuery("INSERT INTO _sequence_{$name} (sequence) VALUES (0)", 0, 0, 0))) { return 0; } if (isset($this->options["Use8ByteIntegers"]) && $this->options["Use8ByteIntegers"]) { ifx_free_result($result); if (!($result = $this->DoQuery("SELECT dbinfo('serial8') FROM _sequence_{$name}"))) { return 0; } $value = intval($this->FetchResult($result, 0, 0)); $this->FreeResult($result); if ($this->auto_commit && isset($this->options["Logging"]) && !strcmp($this->options["Logging"], "ANSI") && !$this->DoQuery("COMMIT")) { return 0; } } else { $sqlca = ifx_getsqlca($result); $value = $sqlca["sqlerrd1"]; ifx_free_result($result); } if (!$this->Query("DELETE FROM _sequence_{$name} WHERE sequence<{$value}")) { $this->warning = "could delete previous sequence table values"; } return 1; }