title: Error: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined PDO
body: <p>I´m new in PHP, and I´m developing an API with SlimFramework 3</p>
  
  <p>I have this POST method </p>
  
  <pre><code>$app-&gt;post('/factura', function(Request $request, Response $response){
      $conn = PDOConnection::getConnection()
      try{
          $sql = "INSERT INTO bd_zapateria.factura
          (
            idCliente,
            idEmpleado,
            fechaFactura,
            subTotal,
            descuento,
            Impuesto,
            totalFactura)
            VALUES
            (:idCliente,
            :idEmpleado,
            :fechaFactura,
            :subtotal,
            :descuento,
            :Impuesto,
            :totalFactura)";
  
            $stmt = $conn-&gt;prepare($sql);
  
            $stmt-&gt;bindParam(':idCliente', $idCliente);
            $stmt-&gt;bindParam(':idEmpleado', $idEmpleado);
            $stmt-&gt;bindParam(':fechaFactura', $fechaFactura);
            $stmt-&gt;bindParam(':subTotal', $subTotal);
            $stmt-&gt;bindParam(':descuento', $descuento);
            $stmt-&gt;bindParam(':Impuesto', $Impuesto);
            $stmt-&gt;bindParam(':totalFactura', $totalFactura);
  
            $idCliente = (int) $request-&gt;getParam("idCliente");
            $idEmpleado = (int) $request-&gt;getParam("idEmpleado");
            $fechaFactura = $request-&gt;getParam("fechaFactura");
            $subTotal = (int) $request-&gt;getParam("subTotal");
            $descuento = (int) $request-&gt;getParam("descuento");
            $Impuesto = (int) $request-&gt;getParam("Impuesto");
            $totalFactura = (int) $request-&gt;getParam("totalFactura");
  
  
            $result = $stmt-&gt;execute();
            echo "New records created successfully";
            echo($result);
            $data['Factura'] = $result;
  
            $response = $response-&gt;withHeader('Content-Type','application/json');
            $response = $response-&gt;withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization');
            $response = $response-&gt;withHeader('Access-Control-Allow-Origin', '*');
            $response = $response-&gt;withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS');
            $response = $response-&gt;withStatus(200);
            $response = $response-&gt;withJson($data);
            return $response;
           }catch (PDOException $e) {
             $this['logger']-&gt;error("DataBase Error.&lt;br/&gt;" . $e-&gt;getMessage());
             echo "Error: " . $e-&gt;getMessage();
           } catch (Exception $e) {
             $this['logger']-&gt;error("General Error.&lt;br/&gt;" . $e-&gt;getMessage());
             echo "Error: " . $e-&gt;getMessage();
           } finally {
            // Destroy the database connection
             $conn = null;
        }
  }); 
  </code></pre>
  
  <p>When I try to send values, using Postman, it returns this error: </p>
  
  <blockquote>
    <p>Error: SQLSTATE[HY093]: Invalid parameter number: parameter was not
    defined</p>
  </blockquote>
  
  <p>I have the correct headers in Postman </p>