I'm trying to update a sql database in java, but it only works in navigators. I am using a GET request for that, because the hosting doesn't allow me to activate the sql remote access.

This is the java function:

```
public static void insertScore(String user, boolean win){
        URL url;
        HttpURLConnection connection=null; 
        try {
            url = new URL("http://mypage/insert.php?user="+user+"&win="+win);
            connection = (HttpURLConnection)url.openConnection();
            connection.setRequestMethod("GET");
            connection.connect();
        } catch (MalformedURLException ex) {
            Logger.getLogger(SQL.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SQL.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

```

And the insert.php file, this file it's ok, but if it helps you:

```
<?php
if($_GET["win"]=='true'){
$sql="UPDATE Score SET  `Win` =  `Win` +1 WHERE  `User` = '".$_GET['user']."'";
}
else{ 
$sql="UPDATE Score SET  `Lose` =  `Lose` +1 WHERE  `User` = '".$_GET['user']."'";
}

$link = mysqli_connect('myhost','myuser','mypassword','mydb'); //everything ok here
if (!$link) {
    die('Error: ' . mysql_error());
}
$result=$link->query($sql);
?>

```

When I paste the link in safari `http://mypage/insert.php?user=Steve&win=true` the Sql database updates correctly, but I don't how to do this using Java, it doesn't update anything in the database...