SQLite help
#1

I want to get all the names and ranks form players in the database that are members of the same gang.

"CLAN" means member

i have written this code but its not working.

Код:
stock SviClanovi(playerid, idorg)
{
    new DBResult: Result, Field1[22], Field2[22], Query[350], string[256];
    
   	format(Query, sizeof(Query), "SELECT * FROM USERS WHERE CLAN = %d GROUP BY Name HAVING count(*) >= 1", idorg);
	Result = db_query(Database, Query);

	do
 	{
		db_get_field_assoc(Result, "NAME", Field1, 30);
		db_get_field_assoc(Result, "RANK", Field2, 30);
		format(string,sizeof(string) , "| %s  | %s", Field1, Field2);
		SCM(playerid, -1, string);

	}
	while(db_next_row(Result));

	
 	db_free_result(Result);
	return true;
}
Reply
#2

can someone help me?
Reply
#3

BUMP!
Reply
#4

Help?
Код:
stock SviClanovi(playerid, idorg)
{
    new DBResult: Result, Field1[24], Field2[24], Query[350], string[256];

   	format(Query, sizeof(Query), "SELECT * FROM USERS WHERE CLAN = %d", idorg);
	Result = db_query(Database, Query);
	new red = db_num_rows(Result);
	for(new i = 0; i < red; i++)
	{
		db_get_field_assoc(Result, "NAME", Field1, sizeof(Field1));
		db_get_field_assoc(Result, "RANK", Field2, sizeof(Field2));
		format(string,sizeof(string) , "| %s  | %s", Field1, Field2);
		SCM(playerid, -1, string);
	}
 	db_free_result(Result);
	return true;
}
i tried like this too but it is still not working
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)