[DUV] Saving In MySql (/email)
#1

I have this command to save the emails in email.txt, was wondering how do I save in MySql (Database), I'm still new to MySql not know how to do

I appreciate your help
pawn Code:
command(email, playerid, params[])
{
    new
        email[128],
        emailstring[128],
        pname[20],
        msgadmins[128];

    if(sscanf(params, "s", email)) return SendClientMessage(playerid, Grey, "/email [email]");

    new File:emails=fopen("emails.txt", io_append);//********SAVING IN MYSQL? **********
    format(emailstring, sizeof(emailstring), "%s\n", email);//********SAVING IN MYSQL? **********
  fwrite(emails, emailstring);//********SAVING IN MYSQL? **********
  fclose(emails);//********SAVING IN MYSQL? **********
 
  GetPlayerName(playerid, pname, sizeof(pname));
  format(msgadmins, sizeof(msgadmins), "%s register email (%s).", pname, email);

    SendClientMessage(playerid, Green, "Thankx For Register!.");

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                SendClientMessage(i, Yellow, msgadmins);
            }
        }
    }
    return 1;
}
Sorry My Bad English, Iam Brazilian
Reply


Messages In This Thread
[DUV] Saving In MySql (/email) - by ipsBruno - 26.05.2010, 14:24
Re: [DUV] Saving In MySql (/email) - by ipsBruno - 26.05.2010, 15:22
Re: [DUV] Saving In MySql (/email) - by whitedragon - 26.05.2010, 15:26
Re: [DUV] Saving In MySql (/email) - by ipsBruno - 26.05.2010, 16:07
Re: [DUV] Saving In MySql (/email) - by whitedragon - 27.05.2010, 05:56

Forum Jump:


Users browsing this thread: 1 Guest(s)