Skip to content

MySQL_GetErrno

imshooter edited this page Oct 24, 2026 · 1 revision

The error of the query read.

native MySQL_GetErrno();

Returns

  • The error number of MySQL.
  • 0 when it succeeded, or no query is read.

Remarks

The error numbers are those of MySQL and MariaDB, such as 1062 for a duplicate key and 1146 for a missing table, and those of the client from 2000, such as 2013 for a connection lost during a query. See Errors.

Example

forward OnAccountMade(playerid);

public OnAccountMade(playerid) {
    switch (MySQL_GetErrno()) {
        case 0: {
            SendClientMessage(playerid, -1, "Your account is ready.");
        }
        case 1062: {
            SendClientMessage(playerid, -1, "That name is taken.");
        }
        default: {
            SendClientMessage(playerid, -1, "The account could not be made.");
        }
    }

    return 1;
}

Related

Clone this wiki locally