mySQL dialog to register/login help - 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: mySQL dialog to register/login help (
/showthread.php?tid=460294)
mySQL dialog to register/login help -
PabloDiCostanzo - 27.08.2013
Greetings,
Hello guys, well today I have a problem. I know about mySQL, I saw a lot of tutorials and I know I need to put this into the script but what I need is someone to help me to put this into the dialog of register and login
Код:
REGISTER:
mysql_query("INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))", PlayerName, password);
LOGIN:
mysql_query("SELECT `password` FROM `users` WHERE `username` = '%s'", PlayerName);
If anyone can help me
Regards,
Pablo
Re: mySQL dialog to register/login help -
cpbarn - 27.08.2013
delet
Re: mySQL dialog to register/login help -
zaider - 27.08.2013
pawn Код:
//REGISTER
new tmp[128];
new name[24];
GetPlayerName(playerid,name,sizeof name);
format(tmp, sizeof(tmp), "INSERT INTO `users` (`username`, `password`) VALUES ('%s', md5('%s'))", name, inputtext);
mysql_query(tmp);
pawn Код:
//LOGIN
new str[100],name[24];
GetPlayerName(playerid,name,sizeof name);
format(str, sizeof(str), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = md5('%s')",name,inputtext);
mysql_query(str);
Re: mySQL dialog to register/login help -
PabloDiCostanzo - 27.08.2013
I mean I need the dialog with this in, I don`t know if anyone understeand but I mean something like.
pawn Код:
ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
And here where enter the //REGISTER //LOGIN data
I don`t know if you understean.
Or maybe the mysql does not enter in the dialog, I don`t know that
Re: mySQL dialog to register/login help -
zaider - 28.08.2013
Look at Register/Login tutorials as you said you have and follow their set-up for the OnDialogResponse. Just replace their Y_INI/DINI code with MySQL
Re: mySQL dialog to register/login help -
[HiC]TheKiller - 28.08.2013
https://sampforum.blast.hk/showthread.php?tid=159785
Have a read through of the register / login section. If you need an even more basic overview then you can PM me and ask for help.
Re: mySQL dialog to register/login help -
[HiC]TheKiller - 28.08.2013
Net glitched and posted the same thing twice.