Repository navigation
MySQL_GetJSONKey
imshooter edited this page Oct 24, 2026
·
1 revision
The name of a member of an object of a JSON cell, by its position.
native bool:MySQL_GetJSONKey(
row,
const field[],
index,
key[],
size = sizeof (key),
const path[] = ""
);| Parameter | Description | Default |
|---|---|---|
row |
The row, from 0. |
|
const field[] |
Name of the field. | |
index |
The member, from 0. |
|
key[] |
Array for the name. | |
size |
Size of the array. | sizeof (key) |
const path[] |
JSON Pointer of the object, or empty for the top one. | "" |
-
truewhen the name was written. -
falsewhen the object has no such member.
The keys come in the order the cell holds them. With path, it reads the keys of an object inside the cell.
Prints every member of a JSON cell.
stock PrintSettings(row) {
new
key[32],
value[64]
;
for (new i, count = MySQL_GetJSONCount(row, "settings"); i != count; ++i) {
MySQL_GetJSONKey(row, "settings", i, key);
MySQL_GetJSONString(row, "settings", key, value);
printf("%s = %s", key, value);
}
}- MySQL_GetJSONCount: How many members an object of a JSON cell has, or how many elements an array has.
- MySQL_GetJSONString: A value of a JSON cell as a string. An object or an array is written as JSON.
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