28.03.2015, 07:46
as bible already said use %e to escapename here example
pawn Code:
stock LoginPlayer(playerid)
{
new Query[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
mysql_format(MySQLConnection,Query, sizeof(Query), "SELECT * FROM `players` WHERE `Name` = '%e'", name);// in mysqlconnection put yours one
mysql_tquery(MySQLConnection, Query, "OnPlayerLogin","d",playerid);
}
public OnPlayerLogin(playerid)
{
new Query[200], name[24], rows, fields;
GetPlayerName(playerid, name , sizeof(name));
cache_get_data(rows,fields,mysqlConnectin);
if(rows) //If the user is found
{
gPlayerAccount[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 0;
}
return 1;
}