SA-MP Forums Archive
[mysql_query] error 035: argument type mismatch (argument 1) - 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_query] error 035: argument type mismatch (argument 1) (/showthread.php?tid=541407)



[mysql_query] error 035: argument type mismatch (argument 1) - lexurs - 11.10.2014

I've been trying to find what the error is in here but I can't find it. I am getting the error at the end on the line that says mysql_query.

Код:
	if(dialogid == DIALOG_ATITLE && response)
	{
	    new giveplayerid;
		new name[MAX_PLAYER_NAME];
		new string[128];
		new number;
		number = PlayerInfo[playerid][pBadgeNum];

		if(IsPlayerConnected(giveplayerid))
		{
 			format(string, sizeof(string), "%s", inputtext);
			TextDrawSetString(Textdraw7, string);;
			new query[128];
			new rank[64];
			new division[64];
			new employer[64];
  			GetPlayerFactionInfo(playerid, rank, division, employer);
			mysql_query("INSERT INTO leoreports (`ID`, `oname`, `obadge`, `odepartment`, `rtitle`) VALUES (\0, '%s', '%i', '%s', '%s')", GetPlayerNameEx(playerid), number, employer, strval(string));
		}
	}
I've also tried using this but I get the same error, no luck at all.
Код:
format(query, sizeof(query), "INSERT INTO leoreports VALUES (\0, '%s', '%d', '%s', '%s')", INVALID_LEOID_ID, GetPlayerNameEx(playerid), number, employer, strval(string));
mysql_query(query);



Re : [mysql_query] error 035: argument type mismatch (argument 1) - Dutheil - 11.10.2014

mysql_query has 2 mandatory arguments.
The first : Connection handle
The second : The query

https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_query

PHP код:
mysql mysql_connect("host""user""database""pass");
mysql_query(mysqlquery); 



Re: [mysql_query] error 035: argument type mismatch (argument 1) - lexurs - 11.10.2014

Still not working :/


Re : [mysql_query] error 035: argument type mismatch (argument 1) - Dutheil - 11.10.2014

The variable "mysql" must be declared on top of your script and mysql_connect in OnGameModeInit.