MySQL help
#1

Hi guys I am learning mysql but I am getting a problem here.

Код:
E:\Shabi\server\test\gamemodes\test.pwn(139) : error 035: argument type mismatch (argument 1)
Код:
138:new adminlvl;
139:mysql_fetch_field_row(adminlvl,"adminlevel");
Reply
#2

Any one please , help fast....
Reply
#3

What Mysql plugin are you using?
Reply
#4

MySQL Plugin R6-2 BY BlueG > https://sampforum.blast.hk/showthread.php?tid=56564
Reply
#5

Any idea Plzzzz
Reply
#6

The adminlvl variable should be a string.

new adminlvl[5];
Reply
#7

Now what about my INT??

Код:
else if(rows == 1)
	{
		new adminlvl[5];
		mysql_fetch_field_row(adminlvl,"adminlevel");
		P_Var[playerid][p_Adminlevel] = adminlvl; //line 154
	}
Код:
E:\Shabi\server\test\gamemodes\test.pwn(154) : error 006: must be assigned to an array
Reply
#8

Use mysql_fetch_int(); - Returns the int.
Reply
#9

He obviously uses the code in a loop, so using mysql_fetch_int is out of the question.

Something like this won't work for obvious reasons:
pawn Код:
new adminlvl[5];
P_Var[playerid][p_AdminLevel] = adminlvl;
What you need to do is use strval, which "converts" string into an integer!
pawn Код:
P_Var[playerid][p_AdminLevel] = strval(adminlvl);
Reply
#10

Thanks for helping.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)