MySQL R7 - Cache
#1

Hello,

I've been recommended to update from r5 to r7, so I began learning these cache functions, but I'm confused. How would I go about using a loop with cache? For example, converting this:

pawn Код:
mysql_query("SELECT * FROM saes_stopsigns");
    mysql_store_result();
    new stopid;
    while(mysql_fetch_row_format(myquery, "|"))
    {
        sscanf(myquery, "p<|>e<iffff>", StopSign[stopid]);
       
        printf("Stop Signs %i ::: %f %f %f", stopid, StopSign[stopid][sPosX], StopSign[stopid][sPosY], StopSign[stopid][sPosZ]);
        stopid++;
    }
To using cache functions. So Far I got this, but I'm not sure:

pawn Код:
new stopids;
    format(query, sizeof(query), "SELECT * FROM saes_stopsigns");
    mysql_function_query(1, query, true, "OnStopSignLoad", "i", stopids);
forward OnStopSignLoad(stopid);
public OnStopSignLoad(stopid)
{
    new rows, fields;
    cache_get_data(rows, fields);

    return 1;
}
Not much, but this is why I ask on here, how would I go about doing this? Thanks in advance to any assistance.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)