Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7822265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:52:45+00:00 2026-06-02T07:52:45+00:00

I am developing in symfony 1.4 using Doctrine ORM. I can’t create a NOT

  • 0

I am developing in symfony 1.4 using Doctrine ORM. I can’t create a NOT IN where clause using an array with ids. This is my code:

$results = Doctrine_Query::create()
  ->from('Asset a')
  ->where('a.id NOT IN (?)', implode(',', $ids))
  ->execute();

The sql for this query that is generated is this one:

WHERE (a.id NOT IN ('1,5,6,7,8,9,10,11,12,13,14,15,17,18,20,24,25,26,29,30,28'))

As you can see is treating the array filled with ids like an string. I tried also without the implode of the array but I get this error:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

The array $ids containing the excluded ids is a plain numeric one.

I can’t find out what is the correct syntax for this clause. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:52:47+00:00Added an answer on June 2, 2026 at 7:52 am

    You have to use whereNotIn (old doc but still ok).

    $results = Doctrine_Query::create()
      ->from('Asset a')
      ->whereNotIn('a.id', $ids)
      ->execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently developing an application using the newest version of symfony, obtained through PEAR. This
Following this tutorial i'm developing a web application using symfony authentication/authorization architecture. After designing
I am developing an application using Symfony 1.4. Is it posible to disable a
I am developing a new application using Symfony. I want to store the passwords
I'm using Aptana as my IDE while developing a Symfony (1.4) site. I have
I am developing an application using symfony2 and using orm.yml files for mapping the
I'm developing game app and using Symfony 2.0. I have many AJAX requests to
I am developing an application using Symfony 2 and Twig for templating. I would
I am developing a somewhat complex, mostly AJAX application using symfony 1.4. It would
I'm developing a little application using Symfony2. I can access all routes with no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.