mySQL dialog to register/login help
#1

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
Reply
#2

delet
Reply
#3

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);
Reply
#4

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
Reply
#5

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
Reply
#6

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.
Reply
#7

Net glitched and posted the same thing twice.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)