Db field name
From SA-MP Wiki
Returns the name of a particular field
(DBResult:dbresult, field, result[], maxlength)
| DBResult:dbresult | The result to get the data from |
| field | The field to get the name from |
| result[] | The result |
| maxlength | The max length of the field |
| Returns | Returns the name of a particular field |
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext,"/getfieldnames",true)) { new DBResult:Result; Result = db_query( Database, "SELECT * FROM `join_log`" ); for(new a;a<db_num_fields(Result);a++) { new info[30]; db_field_name(Result, a, info, 30); printf("Field name: %s",info); } return 1; } return 0; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- db_open: Open an SQLite database
- db_close: Close an SQLite database
- db_query: Query an SQLite database
- db_free_result: Free result memory from a query
- db_num_rows: Get number of rows in result
- db_next_row: Move to the next row
- db_num_fields: Get number of fields in result
- db_get_field: Get content of field with specified ID from current result row
- db_get_field_assoc: Get content of field with specified name from current result row
