Documentation

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-2022
Up