Repository navigation
MySQL_GetRow
imshooter edited this page Oct 24, 2026
·
1 revision
Read the cells of a row into variables in one call, field after field.
Each letter of format reads the next field: i an integer, f a float, b a bool and s[32] a string with the size of its array. - skips a field.
MySQL_GetRow(row, "s[37]is[64]f", uuid, slot, name, price);native MySQL_GetRow(row, const format[], {Float, _}:...);| Parameter | Description |
|---|---|
row |
The row, from 0. |
const format[] |
The fields to read. |
{Float, _}:... |
Values for the specifiers of the query, in order. |
- How many fields were read.
The format has a letter for each field, in the order of the result: i or d an integer, f a float, b a boolean, s[size] a string with the size of its array, and - or _ a field to skip. Spaces are ignored. It reads a row in one call, which is faster than one native for each field.
new MySQL:gDatabase;
forward OnVehiclesRead();
stock LoadVehicles() {
MySQL_Query(gDatabase, "OnVehiclesRead", 0, "SELECT model, x, y, z, angle, plate FROM vehicles");
}
public OnVehiclesRead() {
new
model,
Float:x,
Float:y,
Float:z,
Float:angle,
plate[16]
;
for (new row, rows = MySQL_GetRowCount(); row != rows; ++row) {
MySQL_GetRow(row, "iffffs[16]", model, x, y, z, angle, plate);
SetVehicleNumberPlate(CreateVehicle(model, x, y, z, angle, -1, -1, -1), plate);
}
return 1;
}-
MySQL_GetInt: A cell of the result read as an integer,
0when it is NULL. - MySQL_GetString: A cell of the result read as a string.
- MySQL_GetFieldIndex: The index of a field of the result read, found by its name in any case.
MySQL 0.2.0 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Queries
- Results
- JSON cells
- Prepared statements
- Passwords
- Errors
- TLS
- Coming from R41
- Performance
Reference
Functions