SA-MP Forums Archive
Simpe MySQL register login system not working. - 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: Simpe MySQL register login system not working. (/showthread.php?tid=545706)



Simpe MySQL register login system not working. - Kontrol - 09.11.2014

Hello guys just wondering what im doing wrong here.

http://pastebin.com/WwkWmwkA

Its not registering the account on the Database
i have 3 fields on the structure of the DB

Name - varchar
Password - varchar
AdminLevel - INT




Re: Simpe MySQL register login system not working. - Capua - 10.11.2014

pawn Код:
stock mySQL_init()
{
    mysql_debug(1);
    gHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);

    /* Table Structure - kind of messy, I know. */
    mysql_function_query(gHandle, "CREATE TABLE IF NOT EXISTS `users` ( \
        `ID` int(11) NOT NULL AUTO_INCREMENT, \
        `Name` varchar(24) NOT NULL, \
        `Password` varchar(129) NOT NULL, \
        PRIMARY KEY (`id`) \
    )"
, false, "SendQuery", "");

    return 1;
}
This is just a tip how to handle it. I'm using BlueG's newest MySQL plugin so you gotta upgrade to it if you already haven't.


Re: Simpe MySQL register login system not working. - Kontrol - 10.11.2014

Im using the older version of BlueG's mysql plugin


Re: Simpe MySQL register login system not working. - biker122 - 10.11.2014

Change the password size to 129 in your database and then try.


Re: Simpe MySQL register login system not working. - Kontrol - 10.11.2014

Quote:
Originally Posted by biker122
Посмотреть сообщение
Change the password size to 129 in your database and then try.
Hey, i just tried it, that hasnt changed anything


Re: Simpe MySQL register login system not working. - Sawalha - 10.11.2014

Check ur mysql_log.txt file, there must be something wrong


Re: Simpe MySQL register login system not working. - Kontrol - 10.11.2014

ive checked the log. all is good all i can think of that the code to create the players account in the gamemode is in correct


Re: Simpe MySQL register login system not working. - biker122 - 10.11.2014

Gotcha!
You have an error in your register dialog. @ INSERT INTO query.
pawn Код:
Name, Password, AdminLevel,
Should be
pawn Код:
Name, Password, AdminLevel
I mean, you have an additional "," in the query.[


Re: Simpe MySQL register login system not working. - Sawalha - 10.11.2014

Quote:
Originally Posted by biker122
Посмотреть сообщение
Gotcha!
You have an error in your register dialog. @ INSERT INTO query.
pawn Код:
Name, Password, AdminLevel,
Should be
pawn Код:
Name, Password, AdminLevel
I mean, you have an additional "," in the query.[
^


@Kontrol: when u check mysql log, search for "error" , and yea, that's a syntax error, doesn't appear in your complier, but appears in the mysql_log.txt