PDO::lastInsertId

(no version information, might be only in CVS)

PDO::lastInsertId --  Returns the ID of the last inserted row

Description

int PDO::lastInsertId ( void )

警告

這個函數是實驗性質的。這個函數的行為、名稱、和關於此函數的任何其他文件在未來PHP的發行中可能會在不通知的情況下改變。 使用此延伸需自行承擔風險。

注: Due to differences between database server implementations, this method may not always return a meaningful result.

Return Values

Returns an integer representing the row ID of the last row that was inserted into the database. If the PDO driver does not support this capability, PDO::lastInsertID() issues a PDOWarning exception.