Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-292

Multiple use of named parameter doesn't work

    Details

    • Type: Bug Bug
    • Status: Awaiting Feedback
    • Priority: Minor 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.

        Activity

        Hide
        Alexander added a comment -

        Are you sure you were using the 2.2.2 version of the ORM? Can you try to reproduce this with the latest master?

        Show
        Alexander added a comment - Are you sure you were using the 2.2.2 version of the ORM? Can you try to reproduce this with the latest master?
        Hide
        Steve Müller added a comment -

        Jürgen ping. I cannot reproduce this error, either. Can you please try to reproduce this with the latest master branch? Otherwise I will close this ticket.

        Show
        Steve Müller added a comment - Jürgen ping. I cannot reproduce this error, either. Can you please try to reproduce this with the latest master branch? Otherwise I will close this ticket.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jürgen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: