I have several php functions which serve different purposes. Each of them is executing a specified mysqli query yet only the first query returns results.

Here is my code

```
function setAsNonWorkingProxy(){

    GLOBAL $mysqli, $proxy;

    $port = explode(":",$proxy)[1];
    $proxy = explode(":",$proxy)[0];

    if ($sql2 = $mysqli->prepare("UPDATE proxies SET failed=failed+1 WHERE ip=? AND port=?")) {

        $sql2->bind_param("si",$proxy, $port);

        $sql2->execute();

        $sql2->close();

    }
}

function markProxyAsUsed(){

    GLOBAL $mysqli, $proxy;

    $port = explode(":",$proxy)[1];
    $proxy = explode(":",$proxy)[0];

    if ($sql3 = $mysqli->prepare("UPDATE proxies SET tried=tried+1 WHERE ip=? AND port=?")) {

        $sql3->bind_param("si",$proxy, $port);

        $sql3->execute();

        $sql3->close();
    }
}

setAsNonWorkingProxy();
markProxyAsUsed();

```

When I do this, only the first function that is called, executes the query inside.
The second function is called and the query executed without any errors yet nothing happens. I am using UDPDATE queries inside both functions.

If I change the order of the functions:

```
markProxyAsUsed();
setAsNonWorkingProxy();

```

Again, only the first one works. Why is this happening?