Repository navigation
MySQL_KeepResult
imshooter edited this page Oct 24, 2026
·
1 revision
Keep the result read after its public returns.
native Result:MySQL_KeepResult();- The kept result, which
MySQL_UseResultreads again andMySQL_DestroyResultfrees. -
INVALID_RESULT_IDwhen no result is read.
Inside the public of a query it keeps the result of that query. Outside, it keeps the result of the last MySQL_Run. Keeping a kept result while it is read gives its own id again. A kept result stays until it is destroyed or the script unloads.
Keeps the list of houses read at start, to read it again later.
new Result:gHouses = INVALID_RESULT_ID;
forward OnHousesRead();
public OnHousesRead() {
gHouses = MySQL_KeepResult();
return 1;
}
stock GetHousePrice(index) {
new
price
;
MySQL_UseResult(gHouses);
price = MySQL_GetInt(index, "price");
MySQL_UseResult(INVALID_RESULT_ID);
return price;
}-
MySQL_UseResult: Read a kept result, or go back to the result of the public with
INVALID_RESULT_ID. - MySQL_DestroyResult: Free a kept result.
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