[Tutorial] MySQL Registration System [Threaded Queries(R33+) + Whirlpool]
#41

Hello, mysql plugins do not load it with the tutorial, Do you know what the problem is?
Reply
#42

Quote:
Originally Posted by iFarbod
View Post
Look at the previous posts.
"The tutorial has been updated and got all those mistakes fixed, so you shouldn't worry about it as it works great now."
Why should I? If this is correct, it should work.
Reply
#43

Errors!! Please help me, I copied everything from the tutorial...

Code:
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(67) : error 017: undefined symbol "mysql"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(67) : error 017: undefined symbol "host"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(68) : error 017: undefined symbol "mysql"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(89) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(89) : error 017: undefined symbol "Name"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(89) : warning 215: expression has no effect
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(89) : error 001: expected token: ";", but found "]"
C:\Users\Adi\Desktop\Test\gamemodes\Mysql.pwn(89) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Lines With the errors:
Code:
public OnGameModeInit()
{
	mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG); 
    mysql = mysql_connect(host, user, db, pass);  // Line 67
    if(mysql_errno(mysql) != 0) print("Could not connect to database!"); // Line 68
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnPlayerConnect(playerid)
{
    new query[128]
    GetPlayerName(playerid, Name[playerid], 24); // Line 89
    GetPlayerIp(playerid, IP[playerid], 16);
    mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
    mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
	return 1;
}
I already have these defined:
Code:
#define host    "localhost" 
#define user    "root" 
#define db      "server" 
#define pass    "" 

//dialogs
#define dregister    6287 //dialog register id
#define dlogin        6288 // ^

static
    mysql, //This variable will be used to manage our database
    Name[MAX_PLAYERS][24], //We will use this variable to store player's name.
    IP[MAX_PLAYERS][16] //We will use this variable to store player's ip.
    ;
    
native WP_Hash(buffer[], len, const str[]); 


enum PDATA
{
    ID, 
    Password[129], 
    Admin, 
    VIP,
    Money, 
    Float:posX, 
    Float:posY, 
    Float:posZ

}
new pInfo[MAX_PLAYERS][PDATA]; //Variable that stores enumerator above
Reply
#44

Thank you mate, thank you so much!
Reply
#45

Hi, please help me there: https://sampforum.blast.hk/showthread.php?tid=538330
Reply
#46

i tried your tutorial and made a simple login/register system but login and register works but not updating
like i made /setlevel and i set my level to 5 but when i quit the server level didnt update on db idk why i tried everything
Reply
#47

Quote:
Originally Posted by Namer
View Post
i tried your tutorial and made a simple login/register system but login and register works but not updating
like i made /setlevel and i set my level to 5 but when i quit the server level didnt update on db idk why i tried everything
Check your mysql_log, you probably have an error in your syntax.
Reply
#48

If i use WP_Hash:
Run time error 19: "File or function is not found"

...
Reply
#49

Quote:
Originally Posted by Baltimore
View Post
If i use WP_Hash:
Run time error 19: "File or function is not found"

...
Use this.

https://sampforum.blast.hk/showthread.php?tid=65290
Reply
#50

Thank you.

However if I go once a wrong password it will indeed send me another dialog with the error, but if I re-enters another wrong password I do not have the dialog of error and I can spawn ...
Reply
#51

Quote:
Originally Posted by TakeiT
View Post
Check your mysql_log, you probably have an error in your syntax.
no bro ! everything is fine and no error
Reply
#52

Logging in dosen't work for me. It tells me my password is wrong even though it's right, also it dosen't turn the characters I type in into those circle things.

mysql_log.txt
Quote:

[13:51:59] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "server", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[13:51:59] [DEBUG] CMySQLHandle::Create - creating new connection..
[13:51:59] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[13:51:59] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[13:51:59] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:51:59] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:51:59] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:51:59] [DEBUG] mysql_errno - connection: 1
[13:51:59] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:51:59] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:51:59] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:51:59] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:51:59] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:51:59] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:52:38] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1"
[13:52:38] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `ID` FROM `players` WHERE `Username` = 'aaa' ", callback: "OnAccountCheck", format: "i"
[13:52:38] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution
[13:52:38] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.382 milliseconds
[13:52:38] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[13:52:38] [DEBUG] Calling callback "OnAccountCheck"..
[13:52:38] [DEBUG] cache_get_data - connection: 1
[13:52:38] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[13:52:42] [DEBUG] mysql_format - connection: 1, len: 300, format: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `Money`, `PosX` ,`PosY`, `PosZ`) VALUES ('%e', '%s', '%s', 0, 0, 0..."
[13:52:42] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `M", callback: "OnAccountRegister", format: "i"
[13:52:42] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution
[13:52:43] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - query was successfully executed within 20.534 milliseconds
[13:52:43] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[13:52:43] [DEBUG] Calling callback "OnAccountRegister"..
[13:52:43] [DEBUG] cache_insert_id - connection: 1
[13:52:43] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[13:52:49] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `players` SET `Admin`=%d, `Money`=%d, `posX`=%f, `posY`=%f, `posZ`=%f WHERE `ID`=%d"
[13:52:49] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `Admin`=0, `Money`=0, `posX`=131.999, `posY", callback: "(null)", format: "(null)"
[13:52:49] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[13:52:49] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 22.90 milliseconds
[13:52:49] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving

server_log.txt
Quote:

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R4, ©2005-2014 SA-MP Team

[13:51:59] filterscripts = "" (string)
[13:51:59]
[13:51:59] Server Plugins
[13:51:59] --------------
[13:51:59] Loading plugin: mysql
[13:51:59] >> plugin.mysql: R39-2 successfully loaded.
[13:51:59] Loaded.
[13:51:59] Loading plugin: Whirlpool
[13:51:59]
[13:51:59] ==================
[13:51:59]
[13:51:59] Whirlpool loaded
[13:51:59]
[13:51:59] ==================
[13:51:59]
[13:51:59] Loaded.
[13:51:59] Loaded 2 plugins.

[13:51:59]
[13:51:59] Filterscripts
[13:51:59] ---------------
[13:51:59] Loaded 0 filterscripts.

[13:51:59] main() has been called.
[13:51:59] Number of vehicle models: 0
[13:52:38] Incoming connection: 127.0.0.1:51323
[13:52:38] [join] aaa has joined the server (0:127.0.0.1)
[13:52:43] New account registered. ID: 3
[13:52:49] [part] aaa has left the server (0:1)

Here is my .pwn file, it compiles without any issues:
http://pastebin.com/FRp2Jw6k

Thanks in advance if you help me, sorry if this post is too long!
Reply
#53

How if i am not using xampp? im using a mysql database from my web hosting ? what do i need to define?

please fast reply and i will give REP+
Reply
#54

Quote:
Originally Posted by Justinclaveria123
View Post
How if i am not using xampp? im using a mysql database from my web hosting ? what do i need to define?

please fast reply and i will give REP+
Need help friend.
Send me pm with your skype I can be helping you
Reply
#55

Quote:
Originally Posted by Justinclaveria123
View Post
im using a mysql database from my web hosting
Don't do it. Transferring data over the Internet takes too long to be of any viable use in this game.
Reply
#56

Nevermind fixed!
Reply
#57

Which mysql version is this, it says "file or function not found"
Reply
#58

nice tutorial +
Reply
#59

how to add add more column when our table has already made ?
Reply
#60

Quote:
Originally Posted by VenomMancer
View Post
how to add add more column when our table has already made ?
Use your GUI (phpMyAdmin) to create a new column.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)