Changing from Y_INI to MySQL
#1

I was wondering if anyone could show me how to change from Y_INI to Mysql. I DO NOT want you to do it for me. I want you to show me how to do one or two and explain so I can do the rest. I've never used mySQL before so please explain in details.
Quote:

Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.

Y_INI Code

Enum:
pawn Код:
enum pInfo
{
    pName[MAX_PLAYER_NAME],
    pPass,
    pCash,
    pSkin,
    pAdmin,
    pKills,
    pDeaths,
    aJailed,
    bool:MaterialJob,
    pMaterial,
    pAdress[16]
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Loading data
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Name", PlayerInfo[playerid][pName]);
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("aJailed",PlayerInfo[playerid][aJailed]);
    INI_Bool("Material_Job",PlayerInfo[playerid][MaterialJob]);
    INI_Int("Materials",PlayerInfo[playerid][pMaterial]);
    INI_Int("IP_Adress",PlayerInfo[playerid][pAdress]);
    return 1;
}
Saving on Disconnect:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteString(File, "Name", GetName(playerid) );
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Skin",GetPlayerSkin(playerid) );
    INI_WriteInt(File,"aJailed",PlayerInfo[playerid][aJailed]);
    INI_WriteBool(File,"Material_Job",PlayerInfo[playerid][MaterialJob]);
    INI_WriteInt(File,"Materials",PlayerInfo[playerid][pMaterial]);
    INI_WriteString(File,"IP_Adress",PlayerInfo[playerid][pAdress]);
    INI_Close(File);
MySQL Database



I was wondering if someone could show me and explain in great detail how to save a few of these with MySQL
Note: If you need any extra information just ask. I cut out my IP for security reasons.
Reply


Messages In This Thread
Changing from Y_INI to MySQL - by lramos15 - 27.08.2013, 01:08
Re: Changing from Y_INI to MySQL - by lramos15 - 28.08.2013, 03:21
Re: Changing from Y_INI to MySQL - by Scenario - 28.08.2013, 03:26
Re: Changing from Y_INI to MySQL - by MoshuLabs - 28.08.2013, 03:33
Re: Changing from Y_INI to MySQL - by lramos15 - 28.08.2013, 03:47
Re: Changing from Y_INI to MySQL - by [HiC]TheKiller - 28.08.2013, 06:07
Re: Changing from Y_INI to MySQL - by lramos15 - 28.08.2013, 06:41
Re: Changing from Y_INI to MySQL - by MoshuLabs - 28.08.2013, 07:10
Re: Changing from Y_INI to MySQL - by lramos15 - 28.08.2013, 15:26
Re: Changing from Y_INI to MySQL - by CrazyChoco - 28.08.2013, 15:42

Forum Jump:


Users browsing this thread: 3 Guest(s)