- Home /
Best way to connect to database for my mobile game?
Hey all,
I'm trying to build an RPG for a mobile game (for Android and iOS) that will connect to a server that stores user info like items in inventory, character names, etc. The set up I've got now similar to the Server Side High Score Tutorial (http://www.unifycommunity.com/wiki/index.php?title=Server_Side_Highscores) - basically, Unity connects to PHP scripts running on a Apache/MySQL/PHP server that access MySQL databases there. It's pretty simple so I don't need constant updates or state synchronization.
Before I really commit to this style though, is there a better or more secure way I should do this? Would using something like Photon, SmartFox, or maybe even a custom server have any significant advantages over this sort of client-server communication? Thanks for any input.
Answer by Mortoc · Jul 05, 2012 at 11:30 PM
Photon and SmartFox are for synchronous communication; real-time multiplayer games. Web services are used for asynchronous communication; high score saving, login systems, etc. If your need is asynchronous, then it sounds like you're doing exactly what you need with the php solution.
Answer by tikyorules · Sep 01, 2013 at 05:04 PM
hi, i use x10hosting.com as my server and was able to connect my game to the server, when i run the game on unity i get to send the scores and the name of the player in to the database also i can also grab data from the server and the database and show it to the game. but when i install my game to an android device lets say a tablet, i get to send data from the game to the server but somehow the game won't show the data from the server to the game.... i don't know if its just the device or the code is not applicable to mobile devices, but i am definitely sure its not the connection cause i get to access bot sending and retrieving of data from server to pc/ pc to server.
in short: when using PC i get to send and retrieve data from the server database but when using android devices i get to send data but it won't retrieve data from the server databas.
i used the server side highscore from the unify community: link text
Answer by rodriguez80alvaro · Oct 24, 2017 at 07:46 PM
hi, i use zz.com.ve as my server and was able to connect my game to the server, when i run the game on unity i get to send the scores and the name of the player in to the database also i can also grab data from the server and the database and show it to the game. but when i install my game to an android device lets say a tablet, i get to send data from the game to the server but somehow the game won't show the data from the server to the game.... i don't know if its just the device or the code is not applicable to mobile devices, but i am definitely sure its not the connection cause i get to access bot sending and retrieving of data from server to pc/ pc to server.
Your answer
Follow this Question
Related Questions
Hosted Database for Mobile Game 0 Answers
How to connect a mobile app to an online database? 2 Answers
Microsoft SQL Server error. 0 Answers
Mobile Database for Unity 0 Answers
mystery MYSQL error .. 2 Answers