MySQL scripts
#1

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?
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

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

that's why people 'learn'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)