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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:47:27+00:00 2026-06-11T15:47:27+00:00

PHP (Symfony 2.0): $term = 3; $query = $em->createQuery( SELECT * FROM SoftsystemSupportBundle:Shop WHERE

  • 0

PHP (Symfony 2.0):

$term = "3";

$query = $em->createQuery(
     "SELECT * FROM SoftsystemSupportBundle:Shop WHERE sid REGEXP '^$term'"
);

$shops = $query->getResult();    

Throws an exception:

Error: Expected IdentificationVariable | StateFieldPathExpression |
AggregateExpression | \”(\” Subselect \”)\” | ScalarExpression, got
‘*'”

I want to get all entities where sid field matches regex.

Any ideas whats wrong?

  • 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-11T15:47:29+00:00Added an answer on June 11, 2026 at 3:47 pm

    You are making a misuse of the QueryBuilder object returned by the CreateQuery() method.

    You are writing DQL (Doctrine Query Language) and not MySQL. REGEXP is not a DQL keyword, hence the error.

    You have the same issue of this post: Using REGEXP in Doctrine 2.X ORM.

    A solution is given there.

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

Sidebar

Related Questions

I have an app that I'm porting from PHP/symfony to Ruby/Rails. Though the language
My current project is in Rails. Coming from a Symfony (PHP) and Django (Python)
I'm building a site using symfony php framework. I have a link in my
I am running symfony2 in Windows7 and Xampp: http://localhost/symfony/web/app_dev.php/hello/symfony How do I change web/.htaccess
First post here... I normally develop using PHP and Symfony with Propel and ActionScript
I'm trying to run Symfony 2 PHP unit tests for a REST API in
ValidateGatherType.php namespace D2E\CoreBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilder; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class ValidateGatherType extends
Trying to install Symfony 1.4.11 application on Ubutnu Server + Nginx + php-fpm Nginx
I've got following URL in symfony (specifics not important): /frontend_dev.php/something/25/apple ... and a routing
We have FireSymfony that allows one to view the Symfony, PHP variables in a

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.