Doctrine 1
  1. Doctrine 1
  2. DC-665

Named parameters doesn't work on MSSQL anymore

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      Windows Server 2003. PHP 5.2.12. MS SQL Server 2008

      Description

      After upgrading to Doctrine 1.2.2 queries with named arguments doesn't work anymore.
      Whenever querying like
      $query = Doctrine_Query::create();
      $customer = $query->from('Customers')
      ->where("id = :id"
      , array('id'=>$user['customer_id']))
      ->fetchOne(array(), Doctrine::HYDRATE_ARRAY);

      I get the error
      SQLSTATE[HY000]: General error: 10007 Incorrect syntax near ':'. [10007] (severity 5)

      If changing the query to
      $query = Doctrine_Query::create();
      $customer = $query->from('Customers')
      ->where("id = ?"
      , array($user['customer_id']))
      ->fetchOne(array(), Doctrine::HYDRATE_ARRAY);
      it works fine.
      Testing with MySQL works fine, so it seems contained to MSSQL

        Activity

        Hide
        Dennis Pettersson added a comment -

        Should mention I upgraded from 1.1.6 to 1.2.2, so the problem might be present in earlier 1.2.x versions as well.

        Show
        Dennis Pettersson added a comment - Should mention I upgraded from 1.1.6 to 1.2.2, so the problem might be present in earlier 1.2.x versions as well.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Dennis Pettersson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: