[Help] warning 213: tag mismatch
#1

Everytime I use these [mysql_format & mysql_tquery]:

Код:
mysql_format(g_Sql, query, sizeof(query), "UPDATE `accounts` SET `Cash` = '%i' WHERE `ID` = '%i'",
 PlayerInfo[playerid][Cash], PlayerInfo[playerid][ID]);
mysql_tquery(g_Sql, query, "", "");
I get warning 213: tag mismatch.

My enum is:

Код:
    ID,
    Name[MAX_PLAYER_NAME],
    Password[129],
    Salt[11],
    IP[16],
    Level,
    Admin,
    Cash,
    Kills,
    Deaths,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    Warnings,
    isBanned,







Should I use format instead of mysql_format

Even when I use just mysql_tquery(g_Sql, query) instead of mysql_tquery(g_Sql, query, "", "") I still get warnings, and they ar e annoying. I want to get rid of them




SOLVED BY X337

and kindda by TitanX at the beginning, but I was too dumb to check the case sensitivity
Reply
#2

PHP код:
new g_Sql
to

PHP код:
new MySQL:g_Sql
Reply
#3

Quote:
Originally Posted by TitanX
Посмотреть сообщение
PHP код:
new g_Sql
to

PHP код:
new MySQL:g_Sql
It was already like that...I know the changes after R40
Reply
#4

PHP код:
mysql_tquery(g_Sqlqueryinstead of mysql_tquery(g_Sqlquery""""
use

PHP код:
mysql_query(g_Sqlquery
and what version of include that you are using (open it and check)
Reply
#5

How you defined PlayerInfo? Can you show the entire enum?
Reply
#6

Quote:
Originally Posted by oMa37
Посмотреть сообщение
How you defined PlayerInfo? Can you show the entire enum?
Код:
enum pInfo
{
	//QUERY STORED DATABASE
	ID,
	Name[MAX_PLAYER_NAME],
	Password[129],
	IP[16],
	Level,
	Admin,
	Cash,
	Kills,
	Deaths,
	Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    Warnings,
    isBanned,
    //LastLogin,
    //RegisterDate,
    
    
    //NOT STORED INFO
    pRIP,       	//When a player gets banned, this is activated
	AOnDuty, 		//For the admins to go ON or OFF duty
	ABusy,   		// When the admins are on duty to set tag to BUSY or AVAILABLE
	PasswordFails,  //If they input the password wrongly
	
    
} new PlayerInfo[MAX_PLAYERS][pInfo];
Ignore the pragma tabsize n shit, It's a perfect code in my pawn

Quote:
Originally Posted by TitanX
Посмотреть сообщение
PHP код:
mysql_tquery(g_Sqlqueryinstead of mysql_tquery(g_Sqlquery""""
use

PHP код:
mysql_query(g_Sqlquery
and what version of include that you are using (open it and check)
I use R41-2 version, I've updated everything to the R40 standards as said in the wiki page.

Код HTML:
mysql_tquery

Description:
Sends a query which will be executed in another thread and call a callback 
(if there was one specified) when the execution is successfully finished.

Код HTML:
mysql_query

Description:
This native sends a non-threaded query to the MySQL server. The SA:MP server (the main PAWN thread) 
waits until the query has been executed and then returns the stored cache handle.
I want a threaded query

I can't use mysql_query, I need mysql_tquery. From what I understand tquery is like a transaction and query fulfills all operations simultaneously . So tquery is supposed to wait for the operation to finish and then moves on to the next one, while query can be exploited, right?
Reply
#7

BUMP. How can I remove the warnings and still use mysql_tquery and mysql_format


Sorry for bumping, but I have 150 warnings all the same now.
Reply
#8

Have you declared 'query' as an array?
EDIT: nevermind, this gives a different error. Are you sure your include is R40+?
Reply
#9

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
Have you declared 'query' as an array?
EDIT: nevermind, this gives a different error. Are you sure your include is R40+?
Query is declared as an array with 128 length
I'm 98% sure, when I open the include, this is what I get at the top

/**
* MySQL plugin R41-2
*/



I think the problem is something with the floats, but im not sure what, I mean I get that warning everytime I use tquery and mysql_format. I tried using just format and not mysql_format and it doesn't save on the database, so I have to use mysql_format, but even then, I still have 60 warnings for tquery.
Reply
#10

The fact you get the error when not using the floats indicates that they are not the issue. Do you have multiple instances of the server package on your computer and is one of them using an older version of the include? If so, you may want to double check which editor is used (which instance of pawno.exe).

With pawno, you have to go directly to the server package in which this script is located > pawno folder > pawno.exe > open script > compile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)