Quote:
Originally Posted by Konstantinos
Remove the forward part of it.
pawn Код:
stock GetPlayersRealId(playerid) { new query[71], usersname[MAX_PLAYER_NAME], id; GetPlayerName(playerid, usersname, sizeof(usersname)); format(query, sizeof(query), "SELECT id FROM playerdata WHERE user = '%s' LIMIT 1", usersname); mysql_query(query); mysql_store_result(); if(mysql_num_rows()) { id = mysql_fetch_int(); mysql_free_result(); } return id; }
You had wrong in the syntax: '$s' instead of '%s'. The order by is not useful for that case. First store and then check the rows.
|
I will edit the post when I tried.
EDIT: It works, I will give u rep

.