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 Qvih · Jul 08, 2013 at 05:01 AM · databasemysql

How to get update from database?

Hi! I'm making an educational game that's sort of like a quiz game but with tutorials. I'm using mySQL(online server) as my database and I'm gonna store the questions in there. Since the game is only offline:

1) How can I save the questions from the database to Unity so I don't have to connect to the internet to get the questions from the database?

2) If I add new questions to the database, how can I update it in Unity?

Comment
Add comment · Show 1
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 Benproductions1 · Jul 08, 2013 at 11:21 AM 0
Share

TIP: When building web games (or anything else really)... never.... ever... have the user access the database.

The database server should only be accessible through either an API server or directly through a Web Server.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Benproductions1 · Jul 08, 2013 at 11:35 AM

Hello,

In the future I suggest if you have 2 questions, ask them separately.
None the less, I'm going to answer both your questions.

1) There are so many ways to save data in any application, and that is really dependent on your platform.
If you are building for desktop (or mobile), you can simply save (text) files or have all your data in the registry. Either way is good (however I prefer txt files XD)
If you are building for the Web. The only real way of doing it (The only way you should) is by creating cookies. However you could (please don't) create a plugin that does it as well.

2) As stated in my comment, you never directly access the database server (you shouldn't even be able to get it's IP)
I suggest making a Web Server that accesses the database server for all your questions. I then suggest, that ever time you add or change any data, a certain variable on the server gets changed. In the user data you also have this certain variable. Every time you want to update the client data, the client requests this variable from the server. Only if they do not match, does the client update.
As for the server, I suggest building it in either Python, Ruby or Node.js. If you are familiar with Unityscript, making a Node.js server shouldn't be too difficult :)

Now I would like to address your question. To be honest, this has been asked (and answered) before. You can probably get many answers through a simple google search and get the information you want.
In the future, I suggest asking more precise, less opinionated and more detailed question.

Hope this helps,
Benproductions1

Comment
Add comment · Show 1 · 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 Qvih · Jul 08, 2013 at 12:12 PM 0
Share

@Benproductions1 Thank you very much for answering my question. :) I tried searching about this on Google but I was getting confused because I didn't know if I should make my game for online or offline play only but thanks to your answer I know what to use.

I never got to make text files for Unity but I want to see if that will work and also I'll just use $$anonymous$$ySQL, Xampp, and PHP$$anonymous$$yAd$$anonymous$$ for the main database.

Thank you very much again! :D

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

16 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

When I build a .exe for my game, will my MySQL database go with it when I run it on a different computer? 2 Answers

MySQL Funktionen Hilfe 1 Answer

How do I add login and register? 1 Answer

Unity MySQL Database? 0 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