Skip to content

MySQL_GetResultSetCount

imshooter edited this page Oct 24, 2026 · 1 revision

How many statements of the query read gave a result.

A query with several statements has a result for each. The first one is read until MySQL_SelectResultSet chooses another.

native MySQL_GetResultSetCount();

Remarks

A query holding several statements, with multi_statements on, or a stored procedure gives a set for each statement. The natives read the first one until another is selected.

Example

new MySQL:gDatabase;

stock PrintCounts() {
    if (!MySQL_Run(gDatabase, "SELECT COUNT(*) AS total FROM players; SELECT COUNT(*) AS total FROM bans")) {
        return;
    }

    printf("%i players", MySQL_GetInt(0, "total"));
    MySQL_SelectResultSet(1);
    printf("%i bans", MySQL_GetInt(0, "total"));
}

Related

Clone this wiki locally