mysql_query(sql) error
#1

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?
Reply
#2

It goes like this:

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

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...
Reply
#4

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.
Reply
#5

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...
Reply
#6

Код:
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?
Reply
#7

mysql_query(connectionHandle, mysql);

change connectionHandle to whatever you use..

mysqlConnect = mysql_connect(...)
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)