Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by garytchao · Jul 05, 2012 at 11:21 PM · mobileserverdatabasesqlconnect

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges