Need Help fast
#1

Hello can someone tell me why
pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],Lang[3],Admin[3],VIP[3];
    GetPlayerName(playerid,pName,24);
    format(Query,sizeof(Query),"SELECT * FROM `users_drift` WHERE username = '%s' LIMIT 1",pName);
    mysql_query(Query);
    mysql_store_result();
    mysql_retrieve_row();
    mysql_get_field("Lang",Lang);
    mysql_get_field("Admin",Admin);
    mysql_get_field("VIP",VIP);
    if(mysql_num_rows() == 1){
    player_Language[playerid] = strval(Lang);
    player_Admin[playerid] = strval(Admin);
    player_VIP[playerid] = strval(VIP);
    print(player_Language[playerid]);
    print(player_Admin[playerid]);
    print(player_VIP[playerid]);
This code wont work i think everything is ok
They are all Int in mysql and they have lenght 1 they are 1 or 0
when i print them it says (null)
Reply
#2

pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],Lang[3],Admin[3],VIP[3];
    GetPlayerName(playerid,pName,24);
    format(Query,sizeof(Query),"SELECT * FROM `users_drift` WHERE username = '%s' LIMIT 1",pName);
    mysql_query(Query);
    mysql_store_result();
    mysql_retrieve_row();
    mysql_get_field("Lang",Lang);
    mysql_get_field("Admin",Admin);
    mysql_get_field("VIP",VIP);
    if(mysql_num_rows() == 1){
    player_Language[playerid] = strval(Lang);
    player_Admin[playerid] = strval(Admin);
    player_VIP[playerid] = strval(VIP);
    print(player_Language[playerid]);
    print(player_Admin[playerid]);
    print(player_VIP[playerid]);
    }
    else
    {
     // do nothing
    }
Reply
#3

Actually i have Admin - 1 VIP - 1 Lang - 1
When i print them i get Lang -1 Admin - 0 VIP - 0
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)