SA-MP Forums Archive
mysql_query(sql) error - 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(sql) error (/showthread.php?tid=625175)



mysql_query(sql) error - StRaphael - 29.12.2016

Hello guys!I have an error with a system on mysql:
Error code:
Код:
error 035: argument type mismatch (argument 1)
Line of error:
Код:
mysql_query(sql);
All the code:
Код:
forward Save_Garages();
public Save_Garages()
{
		for(new i=0; i < garageCount+1; i++)
		{
			new sql[256];
			format(sql,sizeof(sql),"UPDATE `garages` SET \
			`Owner`='%s',\
			`Owned`='%d',\
			`Locked`='%d',\
			`Price`='%d',\
			`PosX`='%f',\
			`PosY`='%f',\
			`PosZ`='%f',\
			`Interior`='%d',\
			`UID`='%d'\
			WHERE `UID`='%d'",
			gInfo[i][Owner],
			gInfo[i][Owned],
			gInfo[i][Locked],
			gInfo[i][Price],
			gInfo[i][PosX],
			gInfo[i][PosY],
			gInfo[i][PosZ],
	        gInfo[i][Interior],
			gInfo[i][UID],
			gInfo[i][UID]);
      		mysql_query(sql);
		}
}
How can I resolve that error?


Re: mysql_query(sql) error - AjaxM - 29.12.2016

It goes like this:

PHP код:
mysql_query(query[], resultidextraidconnectionHandle); 
Reference: Click here


Re: mysql_query(sql) error - StRaphael - 29.12.2016

Quote:
Originally Posted by AjaxM
Посмотреть сообщение
It goes like this:

PHP код:
mysql_query(query[], resultidextraidconnectionHandle); 
And where I need to put this code?After mysql_query(sql); or...


Re: mysql_query(sql) error - AjaxM - 29.12.2016

Quote:
Originally Posted by StRaphael
Посмотреть сообщение
And where I need to put this code?After mysql_query(sql); or...
Edit it to your parameters and replace the mysql_query(sql); to it.

Advice: Use mysql_format for updating and things.


Re: mysql_query(sql) error - StRaphael - 29.12.2016

Quote:
Originally Posted by AjaxM
Посмотреть сообщение
Edit it to your parameters and replace the mysql_query(sql); to it.

Advice: Use mysql_format for updating and things.
Код:
error 017: undefined symbol "query"
What I need to do now?I'm begginer at pawn code...


Re: mysql_query(sql) error - StRaphael - 29.12.2016

Код:
forward Save_Garages();
public Save_Garages()
{
    	new var[256];
		for(new i=0; i < garageCount+1; i++)
		{
			format(var, sizeof(var), "UPDATE `garages` SET `Owner`='%s',`Owned`='%d',`Locked`='%d',`Price`='%d',`PosX`='%f',`PosY`='%f',`PosZ`='%f',`Interior`='%d',`UID`='%d' WHERE `UID`='%d'",gInfo[i][Owner],gInfo[i][Owned],gInfo[i][Locked],gInfo[i][Price],gInfo[i][PosX],gInfo[i][PosY],gInfo[i][PosZ],gInfo[i][Interior],gInfo[i][UID],gInfo[i][UID]);
			mysql_query(SQL ,var);
//			mysql_query(query[], resultid, extraid, connectionHandle);
		}
}
This looks more good,right?


Re: mysql_query(sql) error - itsCody - 29.12.2016

mysql_query(connectionHandle, mysql);

change connectionHandle to whatever you use..

mysqlConnect = mysql_connect(...)


Re: mysql_query(sql) error - skuller12 - 29.12.2016

new sql[256];
format(sql,sizeof(sql) LOL

new handle;
mysql_format(handle, sql, 256, etc
mysql_tquery(handle, sql, "", "");

OnGameModeInit()

handle = mysql_connect ( MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS );