How to allow Unity3D to communicate with mySQL

Volkof

Well-Known Member
Reaction score
31
Hi all,

I am working on a Project that requires creating a survey using Unity3D, and uses mySQL to store results.

Problem is, Unity3D does not seems to be able to communicate directly with mySQL, and requires a middleman (like PHP) to do so.

Is there any way to NOT use a middleman?
 

UndeadDragon

Super Moderator
Reaction score
448
I doubt there would be an easy way to directly communicate.

If you wanted to use PHP it would be very simple like so: (very basic form)

Code:
<?php
 
mysql_connect('MYSQL_HOST', 'MYSQL_USERNAME', 'MYSQL_PASSWORD');
mysql_select_db('MYSQL_DB');
 
mysql_query('INSERT INTO users VALUES ('username', 'password');
 

Volkof

Well-Known Member
Reaction score
31
Thanks guys.

After much discussion with my group members, we decided to go with PHP
 

DrEvil

FCRI Associate!
Reaction score
111
From what I understand, you shouldn't connect through Unity3D because people could then get hold of your DB credentials.

Here's some information on how to do it more safely:
http://wiki.unity3d.com/index.php?title=Server_Side_Highscores

I still don't understand how this is safe.
So we are assuming people can look through the code to find the DB credentials... they will find the urls to set/get highscores and the md5 hash to be used. Therefore allowing them to set whatever highscores they want.

I'm not sure if I am missing the point of it, but I cannot seem to make sense of it.:(
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top