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

        Jürgen created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13778 ] jira-feedback2 [ 17613 ]
        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?
        Alexander made changes -
        Status Open [ 1 ] Awaiting Testcase/Feedback [ 10000 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17613 ] jira-feedback3 [ 19971 ]
        made changes -
        Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
        Marco Pivetta made changes -
        Status In Progress [ 3 ] Awaiting Feedback [ 10000 ]
        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.

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-292, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated: