When executing multiple queries using SQL_QueryAndIgnore, do I need to exec each of them in separate handle? Or this is already fine?
Code:
new iError, szError[256]
new Handle:hSQLConnection = SQL_Connect(g_hSQLTuple, iError, szError, charsmax(szError))
if(hSQLConnection != Empty_Handle)
{
SQL_QueryAndIgnore(hSQLConnection,
"CREATE TABLE IF NOT EXISTS rm_servers (\
serverip VARCHAR(32) NOT NULL PRIMARY KEY, \
servername VARCHAR(64) NOT NULL) \
ENGINE=MyISAM DEFAULT CHARSET=utf8;"
)
SQL_QueryAndIgnore(hSQLConnection,
"INSERT INTO rm_servers SET serverip='%s', \
servername='%s' ON DUPLICATE KEY UPDATE servername='%s'", g_ServerIp, g_ServerName, g_ServerName)
SQL_FreeHandle(hSQLConnection)
}
else
{
log_amx("config_init(): SQL Error #%d - %s", iError, szError)
set_fail_state(szError)
}