[mysql_query] error 035: argument type mismatch (argument 1)
#1

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);
Reply
#2

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); 
Reply
#3

Still not working :/
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)