Details
-
Type:
Bug
-
Status:
Awaiting Feedback
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.2.2
-
Fix Version/s: None
-
Component/s: None
-
Security Level: All
-
Labels:None
-
Environment:IIS 7.5, MS-SQL-Server 2005, PHP 5.4.0
Description
In the example in the documentation http://doctrine-dbal.readthedocs.org/en/2.0.x/reference/data-retrieval-and-manipulation.html#dynamic-parameters-and-prepared-statements there is the following example:
$sql = "SELECT * FROM users WHERE name = :name OR username = :name";
$stmt = $conn->prepare($sql);
$stmt->bindValue("name", $name);
$stmt->execute();
When I try this example using pdo_sqlsrv I get the following error:
PDOException: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 11.0]COUNT field incorrect or syntax error
When I use instead the parameters name1 and name2 the query works as expected.