Posts: 68
Threads: 22
Joined: Dec 2013
Reputation:
0
Hi,
I want to please you to explain me how to write stats into tables. I have tried multiply ways but everything was not so sucesfull. For example i have PlayerInfo[playerid][pExpiriencePoint] how can i make it write into table?
I will be very pleased if you can show me some example.
Thanks
Posts: 609
Threads: 93
Joined: Jul 2013
Reputation:
0
You would need to use "INSERT INTO TABLE"
What you could do is make the server load the player stats from the y_ini file and save to the mysql on logout. That would get the players stats from y_ini to mysql.
Posts: 6,129
Threads: 36
Joined: Jan 2009
To my understanding, Y_INI conforms to the basic INI format, so you can convert the files to your database. A good way to do this could be
using this, once your accounts are in the database, you only need to change the way your script loads and saves user information.
Simply changing the code in your script will not support your old user information if you are doing this on a live server, therefore it is important that you convert your user files to be stored in your database.
Take a look at how ORM is used in BlueG's MySQL plugin
here, it is a really simple way to save and load player information.
Posts: 727
Threads: 79
Joined: Mar 2012
Reputation:
0
Why are you going to make backups into a database? why not just save and read it from a database, since a database is much faster then Y_INI, and alot easier.
Posts: 6,129
Threads: 36
Joined: Jan 2009
https://sampforum.blast.hk/showthread.php?tid=461766
http://www.sqlcourse.com/index.html
You just need to have an understanding of how databases work, then you can begin structuring your database. It's very simple when you apply that knowledge.
You haven't been very specific with your question - what are you actually planning on storing if you want more help?