SA-MP Forums Archive
Converting this to MYSQL R7/cache? - 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: Converting this to MYSQL R7/cache? (/showthread.php?tid=470219)



Converting this to MYSQL R7/cache? - 101 - 16.10.2013

Well I was able to learn how to convert the other things (logging in, etc) But this is a bit confusing and I got no idea how to do it.

pawn Код:
stock GetFreeBizID()
{
    mysql_query("SELECT NULL FROM businesses");
    mysql_store_result();
    new rows = mysql_num_rows();
    mysql_free_result();
    return rows;
}
Anyone able to give me a hand?


Re: Converting this to MYSQL R7/cache? - Scenario - 16.10.2013

This typing of function won't work with the cache functions, technically.

You can use the latest version and use y_inline in order to make it work, though. I believe it would be something like this:

pawn Код:
inline Response()
{
    // query code
}

mysql_tquery(connectionHandle, "SELECT `value` FROM `table`", using inline Response, "", "");
Haven't done that in awhile though, so it could be wrong.


Re: Converting this to MYSQL R7/cache? - 101 - 16.10.2013

I know it wont work, but how do I make it work? I'd prefer not using anything from the YSI library as I don't want to have to include the entire thing and make my script compile slower and bigger to get one thing done.