SA-MP Forums Archive
MySQL R7 - 41 - 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 R7 - 41 (/showthread.php?tid=665705)



MySQL R7 - 41 - dillo1000 - 13.04.2019

Hello,

I am currently trying to upgrade my server from R7 to 41. I do not get how mysql_function_query has changed and what it has changed into

This is my code before -

pawn Code:
format(String,sizeof(String),"UPDATE `accounts` SET `Level`=%d,`AdminLevel`=%d,`Money`=%d,`TruckingLicense`=%d,`Job`=%d,`Hours`=%d,`Minutes`=%d,`FishBag`=%d WHERE Name = '%s' LIMIT 1",
                GetPlayerLevel(playerid),PlayerData[playerid][AdminLevel],PlayerData[playerid][Cash],PlayerData[playerid][TruckingLicense],PlayerData[playerid][Job],PlayerData[playerid][Hours],PlayerData[playerid][Minutes],PlayerData[playerid][FishBag],GetName(playerid));
                mysql_function_query(1,String,false,"","");
And this is what I've changed it into. This works but doesn't load certain stuff, it also crashes when a player leaves. I'm not too sure how to update from mysql_function_query

pawn Code:
#define mysql_function_query(%0,%1,%2,%3,"%4"%5)    mysql_tquery(%0,%1,%3,#%4%5)
#define DB mysql_connect(SQL_HOST,SQL_USER,SQL_PASS,SQL_DB)

            format(String,sizeof(String),"UPDATE `accounts` SET `Level`=%d,`AdminLevel`=%d,`Money`=%d,`TruckingLicense`=%d,`Job`=%d,`Hours`=%d,`Minutes`=%d,`FishBag`=%d WHERE Name = '%s' LIMIT 1",
                GetPlayerLevel(playerid),PlayerData[playerid][AdminLevel],PlayerData[playerid][Cash],PlayerData[playerid][TruckingLicense],PlayerData[playerid][Job],PlayerData[playerid][Hours],PlayerData[playerid][Minutes],PlayerData[playerid][FishBag],GetName(playerid));
                mysql_function_query(DB,String,false,"","");
Before anyone lets me know "use the search bar". I have done quite a bit of searching and cannot work out out, although I may just be blind. Thanks!

P.S. I apologise if this is a "noob question"