[09:49:53] [DEBUG] CMySQLHandle::Create - creating new connection.. [09:49:53] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [09:49:53] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [09:49:53] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:49:53] [DEBUG] CMySQLConnection::Connect - connection was successful [09:49:53] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:49:53] [DEBUG] mysql_errno - connection: 1 [09:49:53] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:49:53] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:49:53] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:49:53] [DEBUG] CMySQLConnection::Connect - connection was successful [09:49:53] [DEBUG] CMySQLConnection::Connect - connection was successful bled [09:49:53] [DEBUG] CMySQLConnection::Connect - connection was successful [09:49:53] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:49:53] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:52:20] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT 'Password', 'PlayerID' FROM 'samp_accounts' WHERE 'Username'='%e' LIMIT 1" [09:52:20] [DEBUG] mysql_tquery - connection: 1, query: "SELECT 'Password', 'PlayerID' FROM 'samp_accounts' WHERE 'Userna", callback: "OnAccountCheck", format: "i" [09:52:20] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [09:52:20] [ERROR] CMySQLQuery::Execute[OnAccountCheck] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''samp_accounts' WHERE 'Username'='R' LIMIT 1' at line 1 [09:52:20] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - error will be triggered in OnQueryError [09:53:23] [DEBUG] mysql_format - connection: 1, len: 2048, format: "UPDATE 'samp_accounts' SET 'MaskOn'='%d', 'Admin'='%d', 'Helper'='%d', 'Money'='%d', 'Level'='%d', 'Age'='%d', 'Gender'='%d', 'O..." [09:53:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE 'samp_accounts' SET 'MaskOn'='0', 'Admin'='0', 'Helper'='", callback: "(null)", format: "(null)" [09:53:23] [DEBUG] CMySQLQuery::Execute[] - starting query execution [09:53:23] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''samp_accounts' SET 'MaskOn'='0', 'Admin'='0', 'Helper'='0', 'Money'='0', 'Level' at line 1 [09:53:23] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError [09:54:46] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "roleplay", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [09:54:46] [DEBUG] CMySQLHandle::Create - creating new connection.. [09:54:46] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [09:54:46] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [09:54:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:54:46] [DEBUG] CMySQLConnection::Connect - connection was successful [09:54:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:54:46] [DEBUG] mysql_errno - connection: 1 [09:54:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:54:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:54:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:54:46] [DEBUG] CMySQLConnection::Connect - connection was successful [09:54:46] [DEBUG] CMySQLConnection::Connect - connection was successful [09:54:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:54:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [10:07:56] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "roleplay", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [10:07:56] [DEBUG] CMySQLHandle::Create - creating new connection.. [10:07:56] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [10:07:56] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [10:07:56] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [10:07:56] [DEBUG] CMySQLConnection::Connect - connection was successful [10:07:56] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [10:07:56] [DEBUG] mysql_errno - connection: 1 [10:07:56] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [10:07:56] [DEBUG] CMySQLConnection::Connect - connection was successful [10:07:56] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [10:07:56] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [10:07:56] [DEBUG] CMySQLConnection::Connect - connection was successful [10:07:56] [DEBUG] CMySQLConnection::Connect - connection was successful [10:07:56] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [10:07:56] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [10:08:23] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT 'Password', 'PlayerID' FROM 'samp_accounts' WHERE 'Username'='%e' LIMIT 1" [10:08:23] [DEBUG] mysql_tquery - connection: 1, query: "SELECT 'Password', 'PlayerID' FROM 'samp_accounts' WHERE 'Userna", callback: "OnAccountCheck", format: "i" [10:08:23] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [10:08:23] [ERROR] CMySQLQuery::Execute[OnAccountCheck] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''samp_accounts' WHERE 'Username'='R' LIMIT 1' at line 1 [10:08:23] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - error will be triggered in OnQueryError [10:08:35] [DEBUG] mysql_format - connection: 1, len: 2048, format: "UPDATE 'samp_accounts' SET 'MaskOn'='%d', 'Admin'='%d', 'Helper'='%d', 'Money'='%d', 'Level'='%d', 'Age'='%d', 'Gender'='%d', 'O..." [10:08:35] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE 'samp_accounts' SET 'MaskOn'='0', 'Admin'='0', 'Helper'='", callback: "(null)", format: "(null)" [10:08:35] [DEBUG] CMySQLQuery::Execute[] - starting query execution [10:08:35] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''samp_accounts' SET 'MaskOn'='0', 'Admin'='0', 'Helper'='0', 'Money'='0', 'Level' at line 1 [10:08:35] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
SELECT Password, ID FROM accounts WHERE Username = 'Name';
SELECT `Password`, `ID` FROM `accounts` WHERE `Username` = 'Name';
Column/table/database names are not supposed to be in quotation marks but in between grave accents or no accents at all. Only their value is supposed to be in single quotation marks and only if that value is a string or character.
Example: PHP код:
PHP код:
|
mysql_format(mysql, query, sizeof(query), "SELECT Password, PlayerID FROM samp_accounts WHERE Username = %e LIMIT 1", playername);
The '%e' specifier is a string specifier and should be between quotation marks. The rest is correct.
|
[12:59:55] [DEBUG] mysql_format - connection: 1, len: 512, format: "INSERT INTO `samp_accounts` (`Username`,`Password`, `PlayerIP`, `Admin`, `Helper`) VALUES ('%e', '%e', '%e', 0, 0, 0, 0)" [12:59:55] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `samp_accounts` (`Username`,`Password`, `PlayerIP`, ", callback: "OnAccountRegister", format: "i" [12:59:55] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution [12:59:55] [ERROR] CMySQLQuery::Execute[OnAccountRegister] - (error #1136) Column count doesn't match value count at row 1 [12:59:55] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - error will be triggered in OnQueryError
INSERT INTO samp_accounts (column_count) VALUES (value_count);
[13:27:35] [DEBUG] CMySQLHandle::Create - creating new connection.. [13:27:35] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [13:27:35] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [13:27:35] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [13:27:35] [DEBUG] CMySQLConnection::Connect - connection was successful [13:27:35] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [13:27:35] [DEBUG] mysql_errno - connection: 1 [13:27:35] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [13:27:35] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [13:27:35] [DEBUG] CMySQLConnection::Connect - connection was successful [13:27:35] [DEBUG] CMySQLConnection::Connect - connection was successful [13:27:35] [DEBUG] CMySQLConnection::Connect - connection was successful [13:27:35] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [13:27:35] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [13:31:29] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `Password`, `PlayerID` FROM `samp_accounts` WHERE `Username` = '%e' LIMIT 1" [13:31:29] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `PlayerID` FROM `samp_accounts` WHERE `Userna", callback: "OnAccountCheck", format: "i" [13:31:29] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [13:31:29] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.501 milliseconds [13:31:29] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [13:31:29] [DEBUG] Calling callback "OnAccountCheck".. [13:31:29] [DEBUG] cache_get_data - connection: 1 [13:31:29] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [13:31:39] [DEBUG] mysql_format - connection: 1, len: 512, format: "INSERT INTO `samp_accounts` (`Username`,`Password`, `PlayerIP`, `Admin`, `Helper`) VALUES ('%e', '%e', '%e', 0, 0)" [13:31:39] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `samp_accounts` (`Username`,`Password`, `PlayerIP`, ", callback: "OnAccountRegister", format: "i" [13:31:39] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution [13:31:39] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - query was successfully executed within 35.989 milliseconds [13:31:39] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [13:31:39] [DEBUG] Calling callback "OnAccountRegister".. [13:31:39] [DEBUG] cache_insert_id - connection: 1 [13:31:39] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [13:32:24] [DEBUG] mysql_format - connection: 1, len: 2048, format: "UPDATE `samp_accounts` SET `MaskOn`='%d', `Admin`='%d', `Helper`='%d', `Money`='%d', `Level`='%d', `Age`='%d', `Gender`='%d', `O..." [13:32:24] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `samp_accounts` SET `MaskOn`='0', `Admin`='0', `Helper`='", callback: "(null)", format: "(null)" [13:32:24] [DEBUG] CMySQLQuery::Execute[] - starting query execution [13:32:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.399 milliseconds [13:32:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
mysql_format(mysql, query, sizeof(query), "SELECT `Password`, `PlayerID` FROM `samp_accounts` WHERE `Username` = '%e' LIMIT 1", playername);
mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
public OnAccountCheck(playerid)
{
new rows, fields, string[380];
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "Password", PlayerInfo[playerid][pPassword], mysql, 129);
PlayerInfo[playerid][pPlayerID] = cache_get_field_content_int(0, "ID");
format(string, sizeof(string), "{FFFFFF}Welcome Back, %s\nPlease type in your password used when registerting.\n\nYou have 60 seconds to login or you will be kicked.", RemoveUnderScore(playerid));
ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_INPUT,"{6688FF}Authentication Area",string, "Login", "Quit");
SetPlayerCameraPos(playerid, 1813.1046,-1449.2799,107.7444);
SetPlayerCameraLookAt(playerid, 1649.3676,-1306.5536,132.4665);
}
else
{
format(string, sizeof(string), "{FFFFFF}Welcome, %s\nYou have entered the regisration area, please type your desired password to begin.\n\nRemember! Never give out your password out to anyone.", RemoveUnderScore(playerid));
ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_INPUT,"{6688FF}Registration Area",string,"Continue", "Quit");
SetPlayerCameraPos(playerid, 363.3605,173.5211,1008.3828);
SetPlayerCameraLookAt(playerid, 363.3605,173.5211,1008.3828);
}
return 1;
}