SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/12/2016, 07:29 AM   #1
StRaphael
Big Clucker
 
StRaphael's Avatar
 
Join Date: Nov 2016
Posts: 124
Reputation: 0
Default mysql_query(sql) error

Hello guys!I have an error with a system on mysql:
Error code:
Code:
error 035: argument type mismatch (argument 1)
Line of error:
Code:
mysql_query(sql);
All the code:
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?
StRaphael is offline   Reply With Quote
Old 29/12/2016, 07:35 AM   #2
AjaxM
Big Clucker
 
AjaxM's Avatar
 
Join Date: May 2016
Posts: 159
Reputation: 25
Default Re: mysql_query(sql) error

It goes like this:

PHP Code:
mysql_query(query[], resultidextraidconnectionHandle); 
Reference: Click here
AjaxM is offline   Reply With Quote
Old 29/12/2016, 07:39 AM   #3
StRaphael
Big Clucker
 
StRaphael's Avatar
 
Join Date: Nov 2016
Posts: 124
Reputation: 0
Default Re: mysql_query(sql) error

Quote:
Originally Posted by AjaxM View Post
It goes like this:

PHP Code:
mysql_query(query[], resultidextraidconnectionHandle); 
And where I need to put this code?After mysql_query(sql); or...
StRaphael is offline   Reply With Quote
Old 29/12/2016, 07:40 AM   #4
AjaxM
Big Clucker
 
AjaxM's Avatar
 
Join Date: May 2016
Posts: 159
Reputation: 25
Default Re: mysql_query(sql) error

Quote:
Originally Posted by StRaphael View Post
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.
AjaxM is offline   Reply With Quote
Old 29/12/2016, 07:43 AM   #5
StRaphael
Big Clucker
 
StRaphael's Avatar
 
Join Date: Nov 2016
Posts: 124
Reputation: 0
Default Re: mysql_query(sql) error

Quote:
Originally Posted by AjaxM View Post
Edit it to your parameters and replace the mysql_query(sql); to it.

Advice: Use mysql_format for updating and things.
Code:
error 017: undefined symbol "query"
What I need to do now?I'm begginer at pawn code...
StRaphael is offline   Reply With Quote
Old 29/12/2016, 08:28 AM   #6
StRaphael
Big Clucker
 
StRaphael's Avatar
 
Join Date: Nov 2016
Posts: 124
Reputation: 0
Default Re: mysql_query(sql) error

Code:
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?
StRaphael is offline   Reply With Quote
Old 29/12/2016, 08:45 AM   #7
itsCody
Gangsta
 
Join Date: Nov 2012
Location: Canada
Posts: 521
Reputation: 45
Default Re: mysql_query(sql) error

mysql_query(connectionHandle, mysql);

change connectionHandle to whatever you use..

mysqlConnect = mysql_connect(...)
itsCody is offline   Reply With Quote
Old 29/12/2016, 08:56 AM   #8
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: mysql_query(sql) error

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 );
skuller12 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL Error : Error in mysql_query: Erreur de syntaxe près de PrinceKumar Scripting Help 2 19/07/2015 01:06 PM
mysql_query error. please help ntmp Scripting Help 4 15/09/2014 04:12 PM
Error in mysql_query Ivan_Pantovic Help Archive 2 01/05/2011 07:46 PM
Error in mysql_query Ivan_Pantovic Help Archive 0 01/05/2011 07:30 PM
mysql_query Error sakang Help Archive 5 03/05/2010 09:02 AM


All times are GMT. The time now is 06:00 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.