MySQL return variable
#1

Hello,

I want to get the variable from the field `id` in my MySQL database, this is used to give the players an own ID forever.
I need to get that ID from the database, but I don't know how .

My pawncode:
Код:
public GetPlayersRealId(playerid)
{
	new query[600], usersname[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, usersname, sizeof(usersname));
	format(query, sizeof(query), "SELECT * FROM playerdata WHERE user = '$s' LIMIT 1 ORDER BY id DESC", usersname);
	mysql_query(query);
	if(mysql_num_rows() == 1)
	{
		mysql_store_result(); new resultline[200];
		if(mysql_fetch_row_format(resultline))
		{
		    //Should return the ID.
		}
		mysql_free_result();
	}
	else
	{
	    return 0;
	}
	return 1;
}
Screen of my table:


Help me pleas!
Reply


Messages In This Thread
MySQL return variable - by trukker1998 - 19.02.2014, 09:01
Re: MySQL return variable - by Misiur - 19.02.2014, 10:19
Re: MySQL return variable - by Konstantinos - 19.02.2014, 10:33
Re: MySQL return variable - by trukker1998 - 19.02.2014, 11:14

Forum Jump:


Users browsing this thread: 1 Guest(s)