General Introduction
Features
Settings
Email system
Date and Time
URL rewrite
Special constants
Special variables
Complex logic in filter
CharToDateFunction
Commit
CompareDates
Connect
CurrentDateFunction
CurrentTimeFunction
DateFormatToPHP
DateToCharFunction
DatetimeToTimestampFunction
Disconnect
ForSql
FormatDate
InitTableVarsForEdit
Insert
IsDate
LastID
NextID
ParseSqlBatch
PrepareFields
PrepareInsert
PrepareUpdate
Query
QueryBind
QueryBindSelect
Rollback
RunSqlBatch
StartTransaction
Update
LastID
For use with the MySQL version only!
int CDatabase::LastID()
The method returns the ID of the last added record. Non-static method.
Parameters
No parameters.
See Also
Examples of use
<? function AddResultAnswer($arFields) { $err_mess = (CForm::err_mess())."<br>Function: AddResultAnswer<br>Line: "; global $DB; $arInsert = $DB->PrepareInsert("b_form_result_answer", $arFields, "form"); $strSql = "INS ERT IN TO b_form_result_answer (".$arInsert[0].") VALUES (".$arInsert[1].")"; $DB->Query($strSql, false, $err_mess.__LINE__); return intval($DB->LastID()); } ?>
© «Bitrix24», 2001-2024
Up