SA-MP Forums Archive
save email sqlite - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: save email sqlite (/showthread.php?tid=524461)



save email sqlite - ivan23 - 06.07.2014

I have problems to save the E-mail

I did so, but only saves a 0

PHP код:
if(dialogid == DIALOG_EMAIL)
    {
           new 
string[128];
           if(!
response) return Kick(playerid);
           if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_EMAILDIALOG_STYLE_INPUT,"Email","Enter your E-Mail","Next","Quit");
           
format(stringsizeof(string), "UPDATE `User` SET `EMAIL`='%i' WHERE `Name`='%s'"inputtextNamePlayer(playerid));
           
db_free_result(db_query(Datastring));
           
ShowPlayerDialog(playeridDIALOG_SEXODIALOG_STYLE_LIST,"Sex","Man\nWoman","Next","Quit");
    } 



Re: save email sqlite - tyler12 - 06.07.2014

An email is a string. You will need to use '%s'. You should also consider escaping the email address (DB_Escape).


Re: save email sqlite - Vince - 06.07.2014

Unescaped user input! Beware! A malicious user could easily corrupt your entire user table.


Re: save email sqlite - ivan23 - 06.07.2014

what?