title: Cannot register user on my website (PHP, Unity3D)
body: <p>I have a website and I want to use it as a place where I can store data (like username, password etc.) for my multiplayer game that I'm making in Unity3D. </p>
  
  <p>Now I want to register someone (add the username and password to the MySQL database) using C# and Unity3D. I use the WWW class to communicate to the website. In my point of view the code I made in Unity3D is working fine, but when I visit phpMyAdmin and search for the new registered user, I can't find it. So I figured, the problem must be in the PHP script, but I can't find it.</p>
  
  <p>Once again the problem is that the username and the password are not added to the MySQL table.</p>
  
  <p>I'll post both scripts, although I think the script in Unity3D is working OK. Please note that I'm PHP absolute beginner.</p>
  
  <pre><code>&lt;?php
  
  $mysql_host = "example.host.com";
  $mysql_database = "example_database";
  $mysql_user = "exampleuser";
  $mysql_password = "toomanysecrets";
  
  try
  {
  
  $toQuery = 'SELECT name,
                  password
              FROM basicUserInfo
              ORDER BY name';
  
  if ($_POST["name"] || $_POST["password"])
  {
      $conn = new PDO("mysql:host=$mysql_host;dbname=$mysql_database", $mysql_user,     $mysql_password);
      echo "Connected to $mysql_database at $mysql_host successfully!";
      $forQuery = 'INSERT INTO  `a1936371_userinf`.`basicUserInfo` (
                  `name` ,`password`
                  )
                  VALUES (
                      \'$_POST[\'name\']\',  \'$_POST[\'password\']\'
                      )';
  
          if (!$conn-&gt;query($forQuery))
          {
              echo "Failed to add data!";
          }
          else
          {
              echo "Added data sucessfully";
          }
      //Close the connection
      $conn = null;
  }
  
  } catch (PDOException $pe)
  {
     die("Could not connect to the database $mysql_database:" . $pe-&gt;getMessage());
  }
  </code></pre>
  
  <p>Unity3D:</p>
  
  <pre><code>void Update()
  {
      if (Input.GetKeyDown(KeyCode.S))
      {
          Register("testt", "test1");
      }
  }
  
  public void Register(string playername, string password)
  {
      StartCoroutine(RegisterOnServer(playername, password));
  }
  
  IEnumerator RegisterOnServer(string playerName, string password)
  {
      string url = "http://deathrunserv.net16.net/index.php";
  
      WWWForm form = new WWWForm();
      form.AddField("name", playerName);
      form.AddField("password", password);
  
      WWW www = new WWW(url);
      yield return www;
      Debug.Log("Done!");
  
  }
  </code></pre>