#1

Hi, whats wrong here?

Код:
new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        mysql_free_result();
        mysql_query("SELECT id FROM playerdata WHERE user = '%s'",pname);
        mysql_store_result();
        new uid = mysql_num_rows();
        mysql_free_result();
Shows me this error:

Код:
(4219): error 035: argument type mismatch (argument 2)
Line 4219 is : mysql_query("SELECT id FROM playerdata WHERE user = '%s'",pname)
Reply
#2

Код:
new str[41+MAX_PLAYER_NAME];
format(str,sizeof(str),"SELECT id FROM playerdata WHERE user = '%e'",pname);
mysql_query(str);
Reply
#3

%e specifier works only with mysql_format.

By the way, remove the first mysql_free_result (after getting player's name) as it has no meaning and consider updating to newer version of the mysql plugin.
Reply
#4

Its not outputting the user id.
Reply
#5

https://sampwiki.blast.hk/wiki/MySQL#mysql_fetch_int
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)