31.12.2010, 00:45
replace field/column names and it should work
pawn Код:
stock HasPhone(playerid)
{
if(IsPlayerConnected(playerid))
{
new Query[256],EscapedName[MAX_PLAYER_NAME],pName[MAX_PLAYER_NAME],hasphone;
GetPlayerName(playerid,pName,sizeof(pName));
mysql_real_escape_string(pName, EscapedName);
format(Query, sizeof(Query), "SELECT `Phone` FROM `players` WHERE `Name` = '%s'", EscapedName);
mysql_query(Query);
mysql_store_result();
hasphone = mysql_fetch_int();
mysql_free_result();
return hasphone;
}
else print("[MySQL] HasPhone() was called, to non-connected ID.");
return 0;
}