Cant Update an sql value : <p>i'm trying to update a value on mysql database, but i cant do it, i'm receiving succefully the data from the table, but on update it says 'connection error' i don't know what i'm missing</p>

<p>Panel.php </p>

<pre><code>            &lt;?php
        require_once 'funciones/mysql.php';

        $lista = $conexion-&gt;query("SELECT id, Nombre, apellidoPaterno FROM bomberos");

        if ($lista-&gt;num_rows &gt; 0) {

            while ($row = $lista-&gt;fetch_assoc()) {
                echo "id: " . $row["id"] . " - Name: " . $row["Nombre"] . " " . $row["apellidoPaterno"] . "&lt;br&gt;";
                ?&gt;
                &lt;table class="table table-bordered"&gt;
                    &lt;tr&gt;
                        &lt;td&gt;
                            &lt;img src='images/bomberos/&lt;?php echo $row['id']; ?&gt;.jpg' height="10%" width="10%" style="opacity: 0.5;"/&gt;&lt;br /&gt;&lt;?php echo $row['Nombre'] . " " . $row["apellidoPaterno"]; ?&gt;
                            &lt;br /&gt;
                            &lt;div class="icon-container"&gt;
                                &lt;form method="post" action="funciones/disponible.php"&gt;
                                    &lt;input type="hidden" name="idBombero" value="&lt;?php echo $row['id']; ?&gt;"&gt;
                                    &lt;button type="submit"&gt;&lt;/button&gt;
                                &lt;/form&gt;
                            &lt;/div&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;
                &lt;?php
            }
        } else {
            echo "0 Resultados";
        }
        $conexion-&gt;close();
        ?&gt;
</code></pre>

<p>mysql.php</p>

<pre><code>    &lt;?php
//Datos de la conexion
$servidor = "localhost";
$usuario = "root";
$contraseña = "";
$basedatos = "sidesp";
//crear conexion
$conexion = new mysqli($servidor, $usuario, $contraseña, $basedatos);
//revisar conexion
if ($conexion-&gt;connect_error) {
    die("conexion fallida: " . $conexion-&gt;connect_error);
}
?&gt;
</code></pre>

<p>disponible.php</p>

<pre><code>&lt;?php
require_once 'mysql.php';
$consulta = "UPDATE 'estados' SET 'estado'='1' WHERE 'id'='".$_REQUEST['idBombero']."'";
if ($conexion-&gt;query($consulta) === true) {
    return "Exito!";
}else{
    return "Fallo!";
}
</code></pre>

<p>and... what's the best way to secure all of it?, i mean anti sql injections or decoding</p>
