Repository navigation
MySQL_GetValueInt
imshooter edited this page Nov 3, 2026
·
1 revision
A cell of the result read as an integer.
A cell that is NULL or does not exist leaves value as it was, so the variable can hold a default.
new
level = 1
;MySQL_GetValueInt(0, "level", level);native bool:MySQL_GetValueInt(row, const field[], &value);| Parameter | Description |
|---|---|
row |
The row, from 0. |
const field[] |
Name of the field. |
&value |
Variable for the integer. |
-
truewhen the integer was written. -
falsewhen the cell is NULL or does not exist.
Names are found without regard to case. A name the result does not have is logged once, the first time it is asked for. A cell that is not a whole number, such as 2.5, is cut to 2. The variable keeps its value when the native returns false, so it can hold a default.
forward OnPlayerRead(playerid);
public OnPlayerRead(playerid) {
new
skin = 26,
money
;
MySQL_GetValueInt(0, "skin", skin);
if (MySQL_GetValueInt(0, "money", money)) {
GivePlayerMoney(playerid, money);
}
SetPlayerSkin(playerid, skin);
return 1;
}- MySQL_GetValueFloat: A cell of the result read as a float.
- MySQL_GetRow: Read the cells of a row into variables in one call, field after field.
- MySQL_IsNull: Whether a cell of the result read is NULL.
MySQL 0.3.0 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Queries
- Results
- JSON cells
- Prepared statements
- Passwords
- Errors
- TLS
- Coming from R41
- Performance
Reference
Functions