SA-MP Forums Archive
MySQL caching question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL caching question (/showthread.php?tid=412704)



MySQL caching question - AphexCCFC - 02.02.2013

pawn Код:
stock mySQL_init()
{
    mysql_debug(1);
    g_Handle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
   
    /* Table Structure - kind of messy, I know. */
    mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
        `id` int(11) NOT NULL AUTO_INCREMENT, \
        `name` varchar(24) NOT NULL, \
        `pass` varchar(129) NOT NULL, \
        `salt` varchar(30) NOT NULL, \
        `health` float NOT NULL, \
        `X` float NOT NULL, \
        `Y` float NOT NULL, \
        `Z` float NOT NULL, \
        `A` float NOT NULL, \
        `interior` int(2) NOT NULL, \
        `vw` int(11) NOT NULL, \
        `skin` int(3) NOT NULL, \
        PRIMARY KEY (`id`) \
    )"
, false, "SendQuery", "");

    return 1;
}
pawn Код:
forward SendQuery();
public SendQuery()
{
    // callback for queries that don't fetch data
    return 1;
}
Could someone please give me an example of what to put in this callback?


Re: MySQL caching question - T0pAz - 02.02.2013

Check this tutorial out. Explains almost everything.

Link: https://sampforum.blast.hk/showthread.php?tid=337810


Re: MySQL caching question - AphexCCFC - 02.02.2013

Ah, so basically I could just leave it like it is and everything would work fine?


Re: MySQL caching question - Vince - 02.02.2013

You only need to use a callback for select, show, describe and - in rare occasions - insert statements.