Db num fields

From SA-MP Wiki

Jump to: navigation, search

Db num fields


Get number of fields in a result


Parameters:
(DBResult:dbresult)
DBResult:dbresultThe result of db_query
new DBResult:result;
new string[128];
format(query,sizeof(query),"SELECT password,kills,deaths,level,score FROM `users` WHERE Username = '%s'", PlayerName[playerid]);
result = db_query(USERDB,query);;
format(string,sizeof(string),"You just seleted %d fields from the database", db_num_fields(result));
SendClientMessage(playerid,0xAFAFAFAA,string);
db_free_result(result);

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

  • db_num_fields: Get number of fields in result
  • db_get_field: Get content of field with specified ID from current result row