- Home /
Data Management Issue - How to manage retrieved data from mysql?
I am developing a game(c#) with database(mysql) and web service(php) to retrieving the data. The issue is the data management. There is a table on database with the name of items and it has some columns like id, item_name, item_description, item_prop, update_date, ownerId. I added 70 items to this table manually. The users can also add some items to this table or they can update the items they have already added in the game. My purpose is retrieving the whole affected rows of the table when the user is first logged in and save it as a json file in the game folder. After, read that file to fill the game environment with those items.
I try a way to achieve this. Firstly, i hold an updateDate variable in the game which is past like "1990-05-10 21:15:43". Second, i send this variable to the webservice as '$lastUpdateDate';
and make a query according to that variable at the database. select * from channels where update_date >= '$lastUpdateDate';
and write these rows in a json file as items.json. after that make a second query to retrieve the time and refresh the updateDate variable in the game. select select now() as 'Result';
In this way user would not have to get the whole table and write in json file every login process. So, it would be good for the performance and the internet usage. The problem occurs when the users update an item which is already added before. I can see the updated item, too with the first query, but I wrote it in json file twice in this way.
So, how can i solve this problem? Or do you have any better idea for this approach. Help would be much appreciated. Thank you for your time.
Your answer
Follow this Question
Related Questions
How to upgrade from free to paid version and maintain established player prefrence data? 0 Answers
Storing Constant data in a mobile game 0 Answers
MySQL.data and Unity 1 Answer
Why PlayerPrefs not working although I use "HasKey" and Save() on android? 0 Answers
Storing data on a server to be used for player currency in a multiplayer game 1 Answer