Load entire table from MySQL

Looking to load in base property prices for all of the properties in my game. When a user starts the game it will load up the prices for each individual property from the mysql database.

I know I could do this by loading each individual field from the table and assigning them to the property as a variable but is there any quick way to load it all in as a full table array and assign it to all of the objects in the game at once. Currently in my testing map there is only 20 properties but will be upwards of 200 later so will be a long method doing each property.

Also I am better with C# then I am with JS if thats any help.

Also if it is possible what would be the best way to give each house in the game an ID so that it can match up with the database and automatically fill with the data?

I currently do it by loading a JSON formatted string. I encode it in PHP and decode it in unity.

PHP has a build-in JSON encoder + decoder, and its fairly easy to find one for unity, there’s a whole bunch of them out there! :slight_smile: