SA-MP Forums Archive
MySQL scripts - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL scripts (/showthread.php?tid=77171)



MySQL scripts - Qeux - 09.05.2009

hello i was just wondering if there is a difference between a mysql script and a non-mysql script. If there is could you let me know how to set up a mysql script?


Re: MySQL scripts - Dark_Kostas - 09.05.2009

yeah there is a difference on saving system. Here is an example of a mysql server and normal saving stat system.

Normal
pawn Код:
format(var, 32, "RacingLosses=%d\n",PlayerInfo[playerid][pRaceLosses]);fwrite(hFile, var);
MySQL
pawn Код:
new query[MAX_STRING];
format(query, MAX_STRING, "UPDATE players SET ");
MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "RacingWins", PlayerInfo[playerid][pRaceWins]);
MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);
This is just an example. There are a lot of differences. If you want to see them you can try the Moderntopia GM


Re: MySQL scripts - Think - 09.05.2009

Quote:
Originally Posted by [DK
AzaxYo ]
yeah there is a difference on saving system. Here is an example of a mysql server and normal saving stat system.

Normal
pawn Код:
format(var, 32, "RacingLosses=%d\n",PlayerInfo[playerid][pRaceLosses]);fwrite(hFile, var);
MySQL
pawn Код:
new query[MAX_STRING];
format(query, MAX_STRING, "UPDATE players SET ");
MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "RacingWins", PlayerInfo[playerid][pRaceWins]);
MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);
This is just an example. There are a lot of differences. If you want to see them you can try the Moderntopia GM
that isnt standart mysql script, you can do it however you want, this is just a random script that uses 3 things to save something, you only need the query and samp_mysql_query, for the file you need the 'query' too and than fwrite. BUT the advantage with mysql is that you can organize the users easy and you can edit them very easy, most files (that i did) wouldn't work after one edit.


Re: MySQL scripts - MenaceX^ - 09.05.2009

MySQL is better than anything else, maybe people won't agree with me, but it's faster than other functions, and usefull, you can do many things by using mysql while you can't do when you use something else.


Re: MySQL scripts - Qeux - 09.05.2009

ok... now how do you set up modernotpia? i have XAMPP on my desktop... but i have no clue how to use Mysql


Re: MySQL scripts - Ignas1337 - 27.06.2009

that's why people 'learn'