08.03.2013, 23:50
Quote:
Can you please, PLEASE, add mysql_wait(handle) function? I NEED to return last insert ID. But instead I have to go through lots of stuff because apparently multi-threading is better. I need a function to damn delay my own server if I want to.
|
https://sampwiki.blast.hk/wiki/MySQL#mysql_insert_id
But in your threaded query you must not use the cache feature (I haven't tested with cache)
pawn Код:
public SomeQuery()
{
// ...
mysql_format(mysql, query, "INSERT INTO vehicle (Model) VALUES (%i)", model);
mysql_function_query(mysql, query, false, "InsertMySQL", "i", playerid);
return 1;
}
public InsertMySQL(playerid)
{
SendFormatMessage(playerid, -1, "SERVER: INSERT registered with ID %d", mysql_insert_id());
return 1;
}