I use a script attached to a UI.Button to run a php script in my server. It works fine when i use it for retrieve the scoreboard, but when i try to use into my insert script it just does no work.
Script to access the PHP insertion script:
public string url;
public Text Nome;
public Text Score;
public void Run()
{
StartCoroutine(Gravar());
}
public IEnumerator Gravar()
{
WWW www = new WWW(url+"?name='"+Nome.text+"'&score='"+Score.text+"'");
Debug.Log (www.url);
yield return www;
}
PHP insertion script:
<?PHP
require_once 'app_config.php';
connect();
$Nome = $_GET['name'];
$Score = $_GET['score'];
$query = 'insert into score(score.Nome, score.Score) values('.$Nome.','.$Score.')';
$result = mysql_query($query) or die ('ERRO : ' .mysql_error());
?>
And the PHP script is working, because when i get the url that the console gives me and run it on a browser it work just fine. I can’t figure out why its not working in unity.