11.05.2011, 16:29
Hello,
I've decided to switch from dini to MySQL cause of it's inefficiently. I need to learn whole MySQL and it's pretty hard for me. Now I got a problem in OnPlayerConnect.
Picture which may come usefull
Somehow it always gives "Your name is registered, please use /login.". However, all rows are null. Even if I fill the rows with my account name, and some random stats it gives this message. Why is this?
My connection to the MySQL Database it fine, though. Hope at an answer soon!
Jochem
I've decided to switch from dini to MySQL cause of it's inefficiently. I need to learn whole MySQL and it's pretty hard for me. Now I got a problem in OnPlayerConnect.
pawn Код:
public OnPlayerConnect(playerid)
{
new Playername[MAX_PLAYER_NAME],QueryString[128];
GetPlayerName(playerid,Playername,sizeof(Playername));
format(QueryString,sizeof(QueryString),"SELECT * FROM 'PlayerInfo' WHERE 'Account' = '%s'",Playername);
mysql_query(QueryString);
mysql_store_result();
if(mysql_num_rows() != 0) SendClientMessage(playerid,-1,"Your name is registered, please use /login.");
else if(mysql_num_rows() == 0) SendClientMessage(playerid,-1,"Your name is not registered, please use /register.");
return 1;
}
Somehow it always gives "Your name is registered, please use /login.". However, all rows are null. Even if I fill the rows with my account name, and some random stats it gives this message. Why is this?
My connection to the MySQL Database it fine, though. Hope at an answer soon!
Jochem