I'm having trouble making a decrease in sql with pdo. I'm getting the following error
SQLSTATE [07002]: [Microsoft] [ODBC Driver 11 for SQL Server] COUNT field incorrect or syntax error
code
<?php
ob_start();
include'../../classes/config.php';
session_start();
$username = $_SESSION['ID'];
$creditosplayer = (float)$_POST["creditos"];
try {
$pdo = new PDO($pdoconnection, $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $pdo->prepare("UPDATE [omegashop].[dbo].[cad_users] SET [creditos] = :creditosplayer WHERE [userid] = :user");
$query->bindValue(':creditosplayer', $creditosplayer);
$query->execute();
echo 1;
} catch(PDOException $e) {
echo 'Error: ' . $e->getMessage();
}
What should be the correct parameter for float type?