Skip to content

MySQL_Send

imshooter edited this page Oct 24, 2026 · 1 revision

Send a query that needs no answer.

native bool:MySQL_Send(MySQL:handle, const query[], MYSQL_TAGS:...);

Parameters

Parameter Description
MySQL:handle Handle to send it through.
const query[] The query, formatted with the values after it.
MYSQL_TAGS:... Values for the specifiers of the query, in order.

Returns

  • true when it was sent.
  • false when the handle does not exist, the format is not valid, or a limit of the connection refused it.

Remarks

The query runs after the ones sent before it on the same handle, and nothing is called when it ends. An error is still logged and reported through OnMySQLError. See Specifiers for the values it takes.

Example

new MySQL:gDatabase;

stock LogKill(killerid, victimid, WEAPON:reason) {
    new
        killer[MAX_PLAYER_NAME + 1],
        victim[MAX_PLAYER_NAME + 1]
    ;

    GetPlayerName(killerid, killer, sizeof (killer));
    GetPlayerName(victimid, victim, sizeof (victim));
    MySQL_Send(gDatabase, "INSERT INTO kills (killer, victim, weapon) VALUES (%q, %q, %i)", killer, victim, _:reason);
}

Related

  • MySQL_Query: Send a query, and call a public with context when it is done.
  • MySQL_Run: Run a query and wait for it, after the queries sent before it.
  • MySQL_SendQuery: Send a query built in pieces, and forget it, also when it is refused.

Clone this wiki locally