mysql_fetch_field_row
#5

Read in wikipedia the result of those functions. It's some bad tutorial you readed.
try this:
pawn Code:
MySQL_Login(playerid)
{
    new query[67], pname[24], savingstring[64];
    GetPlayerName(playerid, pname, 24);
    format(query, sizeof(query), "SELECT * FROM users WHERE name = '%s' LIMIT 1", pname);
    mysql_query(query);
    mysql_store_result();
    if(mysql_fetch_row_format(savingstring,"|"))
    {
        mysql_fetch_field_row(savingstring, "level"); SetPlayerScore(playerid, strval(savingstring));
        ResetPlayerMoney(playerid);
        mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "Adminlevel"); Playerdata[playerid][Adminlevel] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "bank"); Playerdata[playerid][Bank] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "exp"); Playerdata[playerid][Exp] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Bank] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "xpos"); Playerdata[playerid][Xpos] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "ypos"); Playerdata[playerid][Ypos] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "zpos"); Playerdata[playerid][Zpos] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "apos"); Playerdata[playerid][Apos] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Tut] = strval(savingstring);
    }
    mysql_free_result();
    SendClientMessage(playerid, -1, "You have been logged in.");
    SetSpawnInfo(playerid, -1, Playerdata[playerid][Skin], Playerdata[playerid][Xpos], Playerdata[playerid][Ypos],                  Playerdata[playerid][Zpos], Playerdata[playerid][Apos], -1, -1, -1, -1, -1, -1);
    SpawnPlayer(playerid);
    return 1;
}
Reply


Messages In This Thread
mysql_fetch_field_row - by wouter0100 - 21.08.2011, 10:15
Re: mysql_fetch_field_row - by Macluawn - 21.08.2011, 10:21
Re: mysql_fetch_field_row - by Jochemd - 21.08.2011, 10:24
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 10:27
Re: mysql_fetch_field_row - by Macluawn - 21.08.2011, 10:34
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 12:31
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 17:27
Re: mysql_fetch_field_row - by wouter0100 - 21.08.2011, 18:21

Forum Jump:


Users browsing this thread: 2 Guest(s)