added amb281 - multiple result sets for MySQL

This commit is contained in:
David Anderson
2007-10-22 21:31:02 +00:00
parent 2d737970d0
commit a86b1c5097
16 changed files with 150 additions and 5 deletions

View File

@ -489,6 +489,34 @@ static cell AMX_NATIVE_CALL SQL_Rewind(AMX *amx, cell *params)
return 1;
}
static cell AMX_NATIVE_CALL SQL_NextResultSet(AMX *amx, cell *params)
{
AmxQueryInfo *qInfo = (AmxQueryInfo *)GetHandle(params[1], Handle_Query);
if (!qInfo)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid query handle: %d", params[1]);
return 0;
}
IResultSet *rs = qInfo->info.rs;
if (!rs)
{
MF_LogError(amx, AMX_ERR_NATIVE, "No result set in this query!");
return 0;
}
if (rs->NextResultSet())
{
return 1;
}
else
{
qInfo->info.rs = NULL;
return 0;
}
}
static cell AMX_NATIVE_CALL SQL_QuoteString(AMX *amx, cell *params)
{
IDatabase *pDb = (IDatabase *)GetHandle(params[1], Handle_Database);
@ -559,6 +587,7 @@ AMX_NATIVE_INFO g_BaseSqlNatives[] =
{"SQL_Rewind", SQL_Rewind},
{"SQL_QuoteString", SQL_QuoteString},
{"SQL_QuoteStringFmt", SQL_QuoteStringFmt},
{"SQL_NextResultSet", SQL_NextResultSet},
{NULL, NULL},
};