SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 26/05/2010, 02:24 PM   #1
ipsBruno
Godfather
 
ipsBruno's Avatar
 
Join Date: Apr 2010
Location: Brazil, Caxias RS
Posts: 6,084
Reputation: 546
Default [DUV] Saving In MySql (/email)

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
__________________
https://github.com/ipsBruno
ipsBruno is offline  
Old 26/05/2010, 03:22 PM   #2
ipsBruno
Godfather
 
ipsBruno's Avatar
 
Join Date: Apr 2010
Location: Brazil, Caxias RS
Posts: 6,084
Reputation: 546
Default Re: [DUV] Saving In MySql (/email)

BuMp

Here My command
pawn Code:
command(email, playerid, params[])
{
new
email[128],
emailstring[128];
if(sscanf(params, "s", email)) return SendClientMessage(playerid, Grey, "/email [email]");
ConnectMySQL();
format(email,sizeof(email),"INSERT INTO `Usuarios` (`email`) VALUES ('%s')",email);
mysql_query(email);
SendClientMessage(playerid, Green, "Obrigado por registares o teu e-mail.");
return 1;
}


==============
** Not Save ***
==============
__________________
https://github.com/ipsBruno
ipsBruno is offline  
Old 26/05/2010, 03:26 PM   #3
whitedragon
Gangsta
 
Join Date: Sep 2009
Posts: 516
Reputation: 2
Default Re: [DUV] Saving In MySql (/email)

what you using? zcmd or what? you have all system in mysql?
__________________
If i have typos sry but dont have time to do spellcheck
whitedragon is offline  
Old 26/05/2010, 04:07 PM   #4
ipsBruno
Godfather
 
ipsBruno's Avatar
 
Join Date: Apr 2010
Location: Brazil, Caxias RS
Posts: 6,084
Reputation: 546
Default Re: [DUV] Saving In MySql (/email)

zcmd

yes completed

xD
__________________
https://github.com/ipsBruno
ipsBruno is offline  
Old 27/05/2010, 05:56 AM   #5
whitedragon
Gangsta
 
Join Date: Sep 2009
Posts: 516
Reputation: 2
Default Re: [DUV] Saving In MySql (/email)

Quote:
Originally Posted by DraKoN
zcmd

yes completed

xD
Ok try
format(email,sizeof(email),"INSERT INTO `Usuarios` (`email`) VALUES ('%s') WHERE ('%s')",email,pname); //he didnt know where to put it..
__________________
If i have typos sry but dont have time to do spellcheck
whitedragon is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySql Saving IP? BurrodaZero Help Archive 0 22/05/2010 01:22 PM
mysql saving prob WardenCS Help Archive 1 17/04/2010 07:37 PM
Saving stats with mysql Ozz Help Archive 2 11/04/2010 10:26 AM
MySQL Saving ON gmx jamesb93 Help Archive 0 17/11/2009 06:11 PM


All times are GMT. The time now is 01:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.