MySQL rows into a Dialog List?
#1

I need some help with this.

I have no clue, whatsoever on how to make this possible, but i'm sure it is possible .. somehow.

I would like a Dialog List, with a MySQL row in it.

So:

Select 'username' from the users database, depending if 'GroupID' = 1. And order it by 'Rank' (Highest rank being at the top) Limit to 8.

I would want it to have access to PAGE's, because there may be many members of the Group.

How am i able to create this? Could anyone help me get started?.

Thanks! +rep will be given!!
Reply
#2

I have a feeling that no-one will help. >.>
Reply
#3

I'm just going to guess you want to list the first 8 people in a certain group in a dialog. This isn't too hard .

pawn Код:
new query[300], userstring[300] = "Users in group: \n";
format(query, sizeof(query), "SELECT username FROM users WHERE GroupID = 1 ORDER BY Rank DESC LIMIT 8");
mysql_query(query);
mysql_store_result();
while(mysql_retrieve_row())
{
    mysql_fetch_field_row(query, "username");
    format(userstring, sizeof(userstring), "%s %s \n", userstring, query);
}
mysql_free_result();
ShowPlayerDialog(playerid,1010,DIALOG_STYLE_MSGBOX,"Members in group",userstring,"Close","Close");
That's a example, I'm not fully sure that it's working as I'm unable to test it .
Reply
#4

hi, thanks for helping me but first i must say:

i need it when you click on one of the users, another dialog pops up, with managing the user. I understand the queries on editing, but unsure on how to tell the script what username im trying to edit, if that makes sense.

also, the groups are designed to have around 50+ members in, so how on earth am i able to create pages??.

and also, i would like to colour code the list. The query would need to get the variable 'grouprank' from the database. grouprank = 6, colour the field red. grouprank = 5, colour the field blue, etc.

again, i thank you for helping and hope you can help me further, and i am sorry for asking for so much!!

im currently on my phone and wont be able to try any code until tomorrow, but thanks!. If you cant figure it out or dont have the time to spare, ill pay for some help tomorrow!
Reply
#5

anyone??
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)