.ini -> MySQL
#1

I'm working for a MySQL save system, which saves player's stats.
But I have at the moment over 20k saved .ini's in my player folder.
Now the question: HOW can I convert all .ini's to mysql rows?
Of course I know that I can add rows "per hand" , but with >20k saved files it take years.
Reply
#2

you can do that when someone connects to the server, the information contained in the file are transferred into the database...
Reply
#3

this is a quick example:
pawn Код:
public OnPlayerConnect(playerid)
{
  new name[MAX_PLAYER_NAME],file[128];
  GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  format(file,sizeof(file),"saves/users/%s.ini",name);
  if(fexists(file))
  {
        new query[128];
        format(query,128,"SELECT * FROM USERS WHERE `name` = %s");
        mysql_query(query);
        if(mysql_numrows == 0) CopyData(playerid);
   }
}
I was planing on doing that to. So give me information on your luck later
I think you can do the CopyData function your self.
Reply
#4

What is better, if I do that all variables will be saved in one database (users), or when I save the things in different databases. Because I have much things to load, like titles, achievements, vip rewards etc. etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)