Help regarding about mysql - 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: Help regarding about mysql (
/showthread.php?tid=636113)
Help regarding about mysql -
KizZweLL - 20.06.2017
Hello, Today I decided to use MySQL instead of y_ini but the problem is, when I try to register my account the account saves on my database and then I logged in with the similar password It let me login to the server even though it is wrong password.
For Example:
Username:KizZweLL
Password:NoobAtMysql
then I tried to login with this password
Password:NoobAtMysqls
I came up on joining the server even though it is a wrong password.
Please help me to fix this.
here's my Code:
PHP Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case LOGIN:
{
if(response)
{
new query[126] , Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(query,sizeof(query),"SELECT * FROM users WHERE name = '%s' AND password = '%s'",Name,inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, ""Caption"Register",""Red"You have entered an invalid password.\n"White"Type your password below to register a new account.","Register","Quit");
}
}
}
My database format is
users:
account password.
Re: Help regarding about mysql -
Stev - 20.06.2017
I would suggest using a more updated MySQL plugin.
https://sampforum.blast.hk/showthread.php?tid=56564
Re: Help regarding about mysql -
KizZweLL - 20.06.2017
I have downloaded version r6 but when I open my server the plugin loaded was version r5.