We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Can Phalcon parse where in (select)?

I am trying following query and getting phalcon parsing exception:


                        country_id
                    FROM
                        OffersCountries
                    WHERE
                        offer_id
                    IN
                        (
                            SELECT
                                offer_id
                            FROM
                                OffersDomains
                            WHERE
                                domain_id = ?0)```

```Syntax error, unexpected token SELECT, near to offer_id FROM OffersDomains... when parsing```

I am using mysql. 

Is it possible to make Phalcon to work with such kind of query?

Which version of PHalcon are you using?

May want to see this post. https://phalcontip.com/discussion/36/how-to-use-subqueries-in-phalcon. Look in comments and subqueries should be supported for 2.0.2. Otherwise use a pdo connection with bound parameter.

I am using 2.0.1. Thanks.