SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/06/2017, 02:15 PM   #1
KizZweLL
Little Clucker
 
KizZweLL's Avatar
 
Join Date: Jan 2016
Location: Philippines
Posts: 26
Reputation: 0
Post Help regarding about mysql

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(playeriddialogidresponselistiteminputtext[])
{
    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(playeridREGISTERDIALOG_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.
__________________
Sometimes impossible can turn into reality.
KizZweLL is offline   Reply With Quote
Old 20/06/2017, 02:19 PM   #2
Stev
Big Clucker
 
Join Date: Oct 2013
Location: United Kingdom
Posts: 148
Reputation: 17
Default Re: Help regarding about mysql

I would suggest using a more updated MySQL plugin.

http://forum.sa-mp.com/showthread.php?t=56564
Stev is offline   Reply With Quote
Old 20/06/2017, 02:30 PM   #3
KizZweLL
Little Clucker
 
KizZweLL's Avatar
 
Join Date: Jan 2016
Location: Philippines
Posts: 26
Reputation: 0
Default Re: Help regarding about mysql

I have downloaded version r6 but when I open my server the plugin loaded was version r5.
__________________
Sometimes impossible can turn into reality.
KizZweLL is offline   Reply With Quote
Reply

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 Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 09:26 AM
[Tutorial] [VIDEO] MySQL ORM r38: How to pair GM with MySQL & creation of registration/connection system cArnasLT Tutorials 3 19/05/2014 03:08 PM
BlueG MySQL plugin - Failed (plugins/mysql.so: undefined symbol: _Z13stringvprintfPKcPc) linuxthefish Plugin Development 10 13/07/2013 11:56 AM
[Tool/Web/Other] MySQL DB Manager - Easily manage your MySQL databases with this remote application fiki574 Tools and Files 13 22/07/2012 10:41 AM


All times are GMT. The time now is 09:34 AM.


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