06.03.2010, 03:27
hi, i'm making a MySQL connection, and I get a problem, when i enter the server it crash.
it stats happening then i put this on the callback OnPlayerConnect
there are no errors/warning when i compile the .pwn
and the log sed:
Can someone tell me what i'm doing wrong
PD: Sorry for my bad english
it stats happening then i put this on the callback OnPlayerConnect
pawn Код:
new playername[MAX_PLAYER_NAME], query[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(query, sizeof(query), "SELECT UserName FROM 'usuarios' WHERE 'UserName' = '%s'", playername);
ConexionMySQL();
mysql_real_escape_string(playername, playername);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1){
PlayerInfo[playerid][Registered] = 1;
}
else{
PlayerInfo[playerid][Registered] = 0;
}
mysql_store_result();
and the log sed:
Код:
[01:11:32] Incoming connection: 127.1.1.1:2092 [01:11:32] [join] The_Chaoz has joined the server (0:127.1.1.1) [01:11:32] MySQL Error (0): Could not execute query. 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 ''usuarios' WHERE 'UserName' = 'The_Chaoz'' at line 1. [01:11:32] MySQL Error (0): Could not store result. 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 ''usuarios' WHERE 'UserName' = 'The_Chaoz'' at line 1.
PD: Sorry for my bad english