Writing Y_INI Player stats into MySQL table
#1

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

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

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

Yea thanks, but, i only want to write user stats into database (table). I dont want to convert whole script onto MySQL, i want to make script which will for ex. OnPlayerSpawn or on some CMd (/backup) to write player stats into Database, not for reading from it. I want make it bee automatically because there is more than 2000+ plus users account and 300 users online
Reply
#5

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

Well because i am not only one owner and the other want y_ini ahh long story....
So anybody now how to make that "backup", actually only write stats into database?
Reply
#7

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

My only problem is that i speak English very bad. To be precise i want to write samo basic things in the databes. Those are, player name, Player Level And Experience.(Playerinfo[Playerid][pLevel] and Playerinfo[Playerid][pExp]

Thanks
Reply
#9

BUMP! Anybody knows it is urgent for me pleaseee help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)