Skip to content

MySQL_AddRow

imshooter edited this page Oct 24, 2026 · 1 revision

Add a row of values to a batch. The values are copied at once.

native bool:MySQL_AddRow(Batch:batch, MYSQL_TAGS:...);

Parameters

Parameter Description
Batch:batch The batch.
MYSQL_TAGS:... A value for each specifier of its statement.

Returns

  • true when the row was added.
  • false when the batch does not exist or the values do not match its statement, and nothing is added.

Remarks

The values are copied at once, so one array can be filled again for the next row. A row whose values do not match the statement is not added, and the rows before it stay.

Example

new Statement:gSaveScore;

stock SaveScores(const ids[]) {
    new const
        Batch:batch = MySQL_CreateBatch(gSaveScore)
    ;

    for (new i; i != MAX_PLAYERS; ++i) {
        if (IsPlayerConnected(i)) {
            MySQL_AddRow(batch, GetPlayerScore(i), ids[i]);
        }
    }

    MySQL_ExecuteBatch(batch);
}

Related

Clone this wiki locally