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.
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; }
#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
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 |
If i use WP_Hash:
Run time error 19: "File or function is not found" ... |
[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 |
---------- 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) |
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+ |
how to add add more column when our table has already made ?
|