Added SQL_GetInsertId()

This commit is contained in:
David Anderson
2006-08-28 19:17:26 +00:00
parent baf406cb6a
commit 9bd22661ff
13 changed files with 93 additions and 14 deletions

View File

@ -46,6 +46,25 @@ bool MysqlQuery::Execute(QueryInfo *info, char *error, size_t maxlength)
return res;
}
bool MysqlQuery::Execute2(QueryInfo *info, char *error, size_t maxlength)
{
bool res = ExecuteR(info, error, maxlength);
if (m_LastRes)
m_LastRes->FreeHandle();
m_LastRes = (MysqlResultSet *)info->rs;
if (info->success)
{
info->insert_id = mysql_insert_id(m_pDatabase->m_pMysql);
} else {
info->insert_id = 0;
}
return res;
}
const char *MysqlQuery::GetQueryString()
{
return m_QueryString;
@ -91,10 +110,5 @@ bool MysqlQuery::ExecuteR(QueryInfo *info, char *error, size_t maxlength)
}
}
if (info->success && error && maxlength)
{
*error = '\0';
}
return info->success;
}