Reputation: 1169
I'm trying to build a query using Doctrine2 QueryBuilder, but this is what I get :
[Syntax Error] line 0, col 69: Error: Expected end of string, got '.'
Here's the query :
SELECT value FROM Stats\MESBundle\Entity\Valeur V WHERE code = SE.ENR.PRIM.FM.ZS
I think the problem is that SE.ENR.PRIM.FM.ZS
contains dots. But I can't change this code. Thus, I have to find a way to solve this without changing the code (which is a variable actually : $code).
Upvotes: 0
Views: 4450
Reputation: 2569
With Mysql, when you use strings, you have to write it between two double-quotes.
The following code should work:
SELECT value FROM Stats\MESBundle\Entity\Valeur V WHERE code = "SE.ENR.PRIM.FM.ZS"
Upvotes: 1
Reputation: 2425
try
SELECT value FROM Stats\MESBundle\Entity\Valeur V WHERE code = 'SE.ENR.PRIM.FM.ZS'
Upvotes: 0