0

I am trying to run this query:

$query =  $this->getEntityManager()
    ->createQuery(
            'SELECT MDPIBackendBundle:Articles   
            FROM MDPIBackendBundle:Articles art
            LEFT JOIN MDPIBackendBundle:ScopusFTPUploads uploaded_art WITH art.id = uploaded_art.article_id
            WHERE uploaded_art.article_id IS NULL AND art.pubdate_published >= "'.$startDate.'" AND art.pubdate_published < "'.$endDate.'"'
    );

And I am geting this error:

[Syntax Error] line 0, col 272: Error: Expected Literal, got '"' 

Do you know where is the problem? Thank you.

1 Answer 1

1

It seems like a typo, you cant use " in sql/dql. Try:

$query =  $this->getEntityManager()
    ->createQuery(
            "SELECT MDPIBackendBundle:Articles   
            FROM MDPIBackendBundle:Articles art
            LEFT JOIN MDPIBackendBundle:ScopusFTPUploads uploaded_art WITH art.id = uploaded_art.article_id
            WHERE uploaded_art.article_id IS NULL AND art.pubdate_published >= '".$startDate."' AND art.pubdate_published < '".$endDate."');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.