Ich möchte derzeit Daten in einer Datenbank erstellen. Allerdings klappt es nicht.
new query[2056];
mysql_format(handle, query, sizeof(query), "INSERT INTO `users` (`name`,`password`,`birth`,`registration`,`sex`,`skin`) VALUES ('%e', MD5('%e'),%e,'%e','%i','%i')", pName(playerid),password,geboren,string,GetPVarInt(playerid,"sex"),GetPVarInt(playerid,"skin"));
mysql_pquery(handle, query, "", "d", playerid);
print(query);
print MySQL Log
Code
[11/08/17 11:40:38] [DEBUG] mysql_format(1, 0xF545D610, 2056, "INSERT INTO `users` (`name`,`password`,`birth`,`registration`,`sex`,`skin`) VALUES ('%e', MD5('%e'),%e,'%e','%i','%i')")
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString(this=0x9d6c7c8, src='Rudolff')
[11/08/17 11:40:38] [DEBUG] CConnection::EscapeString(src='Rudolff', this=0x9e98898, connection=0x9f36b40)
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Rudolff'
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString(this=0x9d6c7c8, src='password')
[11/08/17 11:40:38] [DEBUG] CConnection::EscapeString(src='password', this=0x9e98898, connection=0x9f36b40)
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'password'
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString(this=0x9d6c7c8, src='17.10.1995')
[11/08/17 11:40:38] [DEBUG] CConnection::EscapeString(src='17.10.1995', this=0x9e98898, connection=0x9f36b40)
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString - return value: true, escaped string: '17.10.1995'
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString(this=0x9d6c7c8, src='08.11.2017 - 11:40:38')
[11/08/17 11:40:38] [DEBUG] CConnection::EscapeString(src='08.11.2017 - 11:40:38', this=0x9e98898, connection=0x9f36b40)
[11/08/17 11:40:38] [DEBUG] CHandle::EscapeString - return value: true, escaped string: '08.11.2017 - 11:40:38'
[11/08/17 11:40:38] [DEBUG] mysql_format: return value: '156'
[11/08/17 11:40:38] [DEBUG] mysql_pquery(1, "INSERT INTO `users` (`name`,`password`,`birth`,`registration`,`sex`,`skin`) VALUES ('Rudolff', MD5('password'),17.10.1995,'08.11.2017 - 11:40:38','1','1')", "", "d")
[11/08/17 11:40:38] [DEBUG] CCallback::Create(amx=0x9ecf620, name='', format='d', params=0xf545d5f8, param_offset=5)
[11/08/17 11:40:38] [DEBUG] CHandle::Execute(this=0x9d6c7c8, type=2, query=0xa0cdd7c)
[11/08/17 11:40:38] [DEBUG] CConnectionPool::Queue(query=0xa0cdd7c, this=0x9e9f658)
[11/08/17 11:40:38] [DEBUG] CHandle::Execute - return value: true
[11/08/17 11:40:38] [DEBUG] mysql_pquery: return value: '1'
[11/08/17 11:40:38] [DEBUG] CConnection::Execute(query=0xa0cdd7c, this=0xf431a008, connection=0xa026d58)
[11/08/17 11:40:38] [DEBUG] CQuery::Execute(this=0xa0cdd7c, connection=0xa026d58)
[11/08/17 11:40:38] [ERROR] error #1064 while executing query "INSERT INTO `users` (`name`,`password`,`birth`,`registration`,`sex`,`skin`) VALUES ('Rudolff', MD5('password'),17.10.1995,'08.11.2017 - 11:40:38','1','1')": 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 '.1995,'08.11.2017 - 11:40:38','1','1')' at line 1
[11/08/17 11:40:38] [DEBUG] CConnection::GetError(this=0xf431a008, connection=0xa026d58)
[11/08/17 11:40:38] [DEBUG] CCallback::Create(amx=0x9ecf620, name='OnQueryError', format='dsssd)
Alles anzeigen