int CDatabase::LastID()
The method LastID returns the ID of the last added record.
Warning
For use with the MySQL version only!
No parameters.
<? 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 = "INSERT INTO b_form_result_answer (".$arInsert[0].") VALUES (".$arInsert[1].")"; $DB->Query($strSql, false, $err_mess.__LINE__); return intval($DB->LastID()); } ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |