Querying in an existing cache; Daisy-chaining queries.
#1

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,
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;
}
Note that the above was just a sample code.
Reply


Messages In This Thread
Querying in an existing cache; Daisy-chaining queries. - by Neil. - 22.10.2014, 09:56
Re: Querying in an existing cache; Daisy-chaining queries. - by PowerPC603 - 22.10.2014, 10:57
Re: Querying in an existing cache; Daisy-chaining queries. - by Neil. - 22.10.2014, 11:13

Forum Jump:


Users browsing this thread: 1 Guest(s)