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 6224717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:43:09+00:00 2026-05-24T08:43:09+00:00

In a system I’m working on that uses Propel for handling the database, I’m

  • 0

In a system I’m working on that uses Propel for handling the database, I’m preparing a raw query that needs to accept a varying WHERE IN condition.

A simple example what I’m trying to do is this:

$c = Propel::getConnection();
$q = $c->prepare("SELECT foo FROM bar WHERE blah IN(:ids)");
$q->execute(array(':ids' => array(1, 2, 3, 4, 5)));

Obviously, this isn’t working for me. I’ve also tried using implode(‘,’ array(1, 2, 3, 4, 5)) as my ‘:ids’ parameter, which also doesn’t work. The first method complains of having to accept an array, and the second method complains of comparing a string to an integer.

Is there a proper way to pass an array of values to a query for a WHERE IN? I don’t want to hard code it, as that would mean preparing it for every iteration of a loop.

Note that I don’t really have the option of creating a criteria and using doSelect instead, as the query is actually far more complicated than the example given here and I seriously doubt I could build it that way.

Many 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-05-24T08:43:10+00:00Added an answer on May 24, 2026 at 8:43 am

    You cannot use a named parameter marker of the same name twice in a prepared statement. You cannot bind multiple values to a single named parameter in, for example, the IN() clause of an SQL statement.

    PDO::prepare

    Propel uses PDO

    Propel site

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
System.Net.WebException: The server returned an address in response to the PASV command that is
System.Collections.Concurrent has some new collections that work very well in multithreaded environments. However, they
System.Windows.Forms.ComboBox has two different events that the programmer can handle: SelectionChangeCommitted - event fires
System uses dom parser in python 2.7.2. The goal is to extract the .db
System.out.println(Integer.MAX_VALUE + 1 == Integer.MIN_VALUE); is true. I understand that integer in Java is
System.Windows.Forms.Form.CancelButton : Gets or sets the button control that is clicked when the user
System.IO.Directory.GetFiles() returns a string[] . What is the default sort order for the returned
System.IO.BinaryReader reads values in a little-endian format. I have a C# application connecting to
System.Drawing.Color objects apparently won't serialize with XmlSerializer. What is the best way to xml

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.