Db field name

From SA-MP Wiki

Jump to: navigation, search


Returns the name of a particular field


Parameters:
(DBResult:dbresult, field, result[], maxlength)
DBResult:dbresultThe result to get the data from
fieldThe field to get the name from
result[]The result
maxlengthThe max length of the field


ReturnsReturns 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_get_field: Get content of field with specified ID from current result row
Personal tools
In other languages