Posts: 1,648
Threads: 482
Joined: Jun 2010
pawn Код:
stock GetSQLName(playersqlid)
{
new szQuery[256];
format(szQuery, sizeof(szQuery), "SELECT `PlayerName` FROM `accounts` WHERE `id` = %d", playersqlid);
mysql_tquery(dbHandle, szQuery, "SQLName", "");
return 1;
}
forward SQLName();
public SQLName()
{
new result[64];
return cache_get_row(0, 0, result);
}
When I pickup a pickup it returns the command I typed or whatever?
Posts: 1,648
Threads: 482
Joined: Jun 2010
I know, I was testing it.
pawn Код:
OwnedString[x] = format(string, sizeof(string), "~g~Address:~w~ %s ~n~ ~g~Owner:~w~ %s", HouseName[x], GetSQLName(HouseOwner[x]));
Posts: 1,648
Threads: 482
Joined: Jun 2010
It prints whatever I typed in chat.
Posts: 2,593
Threads: 34
Joined: Dec 2007
Use old mysql style xd
pawn Код:
stock GetSQLName(playersqlid)
{
new Cache:result, string[128];
format(string, sizeof(string), "SELECT `PlayerName` FROM `accounts` WHERE `id` = %d LIMIT 1", playersqlid);
result = mysql_query(dbHandle, string);
string = "N/A"; // if id doesnt exist
if(cache_num_rows())
cache_get_row(0, 0, string, dbHandle, MAX_PLAYER_NAME);
cache_delete(result);
return string;
}
Posts: 1,648
Threads: 482
Joined: Jun 2010
Posts: 1,648
Threads: 482
Joined: Jun 2010