Hi all,
I'm having trouble with sending parameters in my threaded query callback. The thing is that I need more than 1 variable to pass through to the callback.
Background Information
When a player death is inserted in the database. I need to link it to foreign keys like killtypeid, weaponid, and teamid. For that I need to query 3 times to different tables to get the correct id to use as foreign key. So I want to do that after I get the event ID I just inserted. Therefore I need to pass more information through the callback.
Code I am trying
PHP Code:
enum eventContent
{
String:m_eventType[64],
String:m_weapon[64],
String:m_victimTeamName[64],
String:m_attackerTeamName[64],
m_gameEventIdentifier
};
//Just demo content
new eventInfo[eventContent] =
{
"kill", "ak47", "T", "CT", 1920394
}
new String:eventQuery[200];
FormatEx(eventQuery, sizeof(eventQuery), "INSERT INTO matchEvents (timestamp, tickTime, matchId, playerId, targetId, roundNumber, isWarmup) VALUES ('%d', '%f', '%d', '%d', '%d', '%d', '%d')", timestamp, tickTime, g_matchId, g_playerDatabaseIds[attackerId], g_playerDatabaseIds[victimId], g_roundNumber, g_isWarmup);
//Normally as data you insert here the client id or just an int. I want it to be an array of multiple data types (ints and chars).
g_Database.Query(SQL_Insert_Death, eventQuery, eventInfo);
In the SQL_Insert_Death callback I want get the last inserted event id. And in that next callback I want to use the different information stored in eventInfo to update that event with the ID's I achieved in the next queries. Does that make sense?
How can I send an array or an enum as parameter with a callback?