Tag mismatch!!
#1

Hey all,
I have got warning 213: tag mismatch
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\server\pawno\include\bgedition.inc(211) : warning 213: tag mismatch
D:\Program Files\Rockstar Games\GTA San Andreas\server\pawno\include\bgedition.inc(212) : warning 213: tag mismatch
D:\Program Files\Rockstar Games\GTA San Andreas\server\pawno\include\bgedition.inc(221) : warning 213: tag mismatch
and this is the code
Код:
#define SQLTYPE_MYSQL 1
#define SQLTYPE_SQLITE 2
#define SQLTABLE_ACTION_CREATE 1
#define SQLTABLE_ACTION_DROP 2

stock SQLTable(connection, sqltype, action, tablename[], string[]) {
	new Query[2000];
	if(action == SQLTABLE_ACTION_CREATE) {
		if(sqltype == SQLTYPE_MYSQL) {
			mysql_format(connection, Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS `%s`(%s)", tablename, string);
			if(strfind(string, "AUTOINCREMENT", false)) strins(string, "_", strfind(string, "AUTO", false), -1);
			mysql_tquery(connection, Query, "", "");
		} else if(sqltype == SQLTYPE_SQLITE) {
			format(Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS `%s`(%s)", tablename, string);
			if(strfind(string, "AUTO_INCREMENT", false)) strdel(string, EOF, strfind(string, "AUTO", false) + 1);
			db_query(connection, "PRAGMA synchronous = OFF");
			db_query(connection, Query);
		}
	} else if(action == SQLTABLE_ACTION_DROP) {
		if(sqltype == SQLTYPE_MYSQL) {
			mysql_format(connection, Query, sizeof(Query), "DROP TABLE IF EXISTS `%s` CASCADE", tablename);
			mysql_tquery(connection, Query, "", "");
			#pragma unused string
		} else if(sqltype == SQLTYPE_SQLITE) {
			format(Query, sizeof(Query), "DROP TABLE IF EXISTS `%s` CASCADE", tablename);
			db_query(connection, Query);
			#pragma unused string
		}
	}
	return 1;
}
there are some screenshots for more info if I'm not posted it here
Reply
#2

EDIT:

Okay, that should work:

pawn Код:
db_query(DB:connection, ...);
Reply
#3

Also look at this
Код:
//- mysql connection
#define mysql_host "localhost"
#define mysql_user "root"
#define mysql_password "bg3diti0n"
#define mysql_database "bgeditiontestsamp"

//- news
new DB:sql_handle[50], mysql_handle[50], mysql_conatt = 5, bool:mysql_connected[50] = false;

public OnGameModeInit() {
	mysql_conatt = 5;
	mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
	mysql_handle[0] = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
	if(mysql_errno(mysql_handle[0]) == 0)return print("[DEBUG]: Connected to the MySQL database!"), mysql_connected[0] = true;
	else {
		mysql_reconnect(mysql_handle[0]);
		mysql_conatt--;
		if(mysql_conatt == 0) {
			mysql_connected[0] = false;
			print("[ERROR]: Could not connect to the MySQL database! Loading the SQLite database.");
			sql_handle[0] = db_open("/Databases/Server.db");
			SQLTable(sql_handle[0], SQLTYPE_SQLITE, SQLTABLE_ACTION_CREATE, "accounts", "`ID` int(11) NOT NULL, `Username` varchar(25) NOT NULL, `Password` varchar(150) NOT NULL, `IP` varchar(16) NOT NULL");
		}
	}
	return 1;
}
I'm trying to make two save systems in my gamemode
Reply
#4

Also look at this
Код:
//- mysql connection
#define mysql_host "localhost"
#define mysql_user "root"
#define mysql_password "bg3diti0n"
#define mysql_database "bgeditiontestsamp"

//- news
new DB:sql_handle[50], mysql_handle[50], mysql_conatt = 5, bool:mysql_connected[50] = false;

public OnGameModeInit() {
	mysql_conatt = 5;
	mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
	mysql_handle[0] = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
	if(mysql_errno(mysql_handle[0]) == 0)return print("[DEBUG]: Connected to the MySQL database!"), mysql_connected[0] = true;
	else {
		mysql_reconnect(mysql_handle[0]);
		mysql_conatt--;
		if(mysql_conatt == 0) {
			mysql_connected[0] = false;
			print("[ERROR]: Could not connect to the MySQL database! Loading the SQLite database.");
			sql_handle[0] = db_open("/Databases/Server.db");
line 30:		SQLTable(sql_handle[0], SQLTYPE_SQLITE, SQLTABLE_ACTION_CREATE, "accounts", "`ID` int(11) NOT NULL, `Username` varchar(25) NOT NULL, `Password` varchar(150) NOT NULL, `IP` varchar(16) NOT NULL");
		}
	}
	return 1;
}
I'm trying to make two save systems in my gamemode

EDIT:
I also have the same warning but in line 30 from my gamemode

EDIT 2: Sorry for the double posting.
Reply
#5

I edited the post, re-look it. I hope it will pass the value without tag with no issues.

About the above:
pawn Код:
SQLTable(_:sql_handle[0], ...);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)