Repository navigation
MySQL_ClearQuery
imshooter edited this page Oct 24, 2026
·
1 revision
Empty a query being built, to build another in it.
native bool:MySQL_ClearQuery(Query:query);| Parameter | Description |
|---|---|
Query:query |
Query to empty. |
-
truewhen it was emptied. -
falsewhen it does not exist.
The query keeps its handle, so one query can be filled again and again, such as the JSON of each row of a batch, without making a new one each time.
Writes the attributes of each item as JSON and adds them to a batch.
new
Statement:gSaveItem,
gItemName[100][32],
gItemAmount[100]
;
stock SaveItems(MySQL:handle) {
new const
Batch:batch = MySQL_CreateBatch(gSaveItem),
Query:json = MySQL_CreateQuery(handle)
;
for (new i; i != sizeof (gItemAmount); ++i) {
MySQL_ClearQuery(json);
MySQL_AppendQuery(json, "{%j: %j, %j: %i}", "name", gItemName[i], "amount", gItemAmount[i]);
MySQL_AddRow(batch, i, json);
}
MySQL_DestroyQuery(json);
MySQL_ExecuteBatch(batch);
}- MySQL_CreateQuery: Start a query to build a piece at a time.
- MySQL_TrimQuery: Remove characters from the end of a query, such as the comma after the last row.
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