SA-MP Forums Archive
MySQL help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL help (/showthread.php?tid=315509)



MySQL help - Shabi RoxX - 03.02.2012

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");



Re: MySQL help - Shabi RoxX - 03.02.2012

Any one please , help fast....


Re: MySQL help - thimo - 03.02.2012

What Mysql plugin are you using?


Re: MySQL help - Shabi RoxX - 03.02.2012

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


Re: MySQL help - Shabi RoxX - 03.02.2012

Any idea Plzzzz


Re: MySQL help - MP2 - 03.02.2012

The adminlvl variable should be a string.

new adminlvl[5];


Re: MySQL help - Shabi RoxX - 03.02.2012

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



Re: MySQL help - T0pAz - 03.02.2012

Use mysql_fetch_int(); - Returns the int.


Re: MySQL help - AndreT - 03.02.2012

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);



Re: MySQL help - Shabi RoxX - 03.02.2012

Thanks for helping.....