22.10.2014, 09:56
Is it a good practice to query once more when i'm on a callback from where I was sent into by the main query? I just made this right now to show my point,
Note that the above was just a sample code.
pawn Code:
public SampleCallback()
{
mysql_format(mysql, query, sizeof(query), "SELECT blabla FROM blabla LIMIT 1");
mysql_tquery(mysql, query, "AnotherCallback");
return 1;
}
public AnotherCallback()
{
cache_get_data(0, 0, SomeVar, mysql, sizeof(SomeVar));//grab the result set here
mysql_format(mysql, query, sizeof(query), "SELECT somethingelse FROM sometable");
mysql_tquery(mysql, query, "OnceMore", "i", SomeVar);
return 1;
}
public OnceMore(SomeVar)
{
cache_get_data(0, 0, SomeVar2);
SomeGlobalVar = SomeVar + SomeVar2;
return 1;
}