Quote:
Originally Posted by CrazY.
Try this.
Code:
formatex( szQuery, 3799, "UPDATE matches SET left_score = '%i', right_score = '%i' WHERE match_id = '%i';", scoreCTS, scoreTS, match_id);
But the real problem is in your g_hTuple. Are you sure the connection was made successfully? Also, SQL_GetInsertId will return 0 if you not use INSERT query before.
|
Thanks CrazY. My insert into looks like that:
PHP Code:
formatex(szQuery, 3799, "INSERT INTO matches (`match_id`, `map`, `played_at`, `left_score`, `right_score`, `state`, `server`, `left_team_id`, `right_team_id`, `game_id`) VALUES ('%s', '%s', NOW(), '0', '0', '0', 'cs.bigmatches.me', '1', '1', '3');", match_id, map_name);
Also g_hTuple:
PHP Code:
public MySQLx_Init()
{
g_hTuple = SQL_MakeDbTuple(GAME_HOST, GAME_USER, GAME_PASSWORD, GAME_DATABASE);
for(new i = 0; i < sizeof szTables; i++)
{
SQL_ThreadQuery(g_hTuple, "QuerySetData", szTables[i]);
}
}