Sorry, but I did not notice. Can you explain?

Em quinta-feira, 6 de março de 2014 14h36min13s UTC-3, Christophe COEVOET 
escreveu:
>
>  Le 06/03/2014 17:52, João Carlos Santa Ana a écrit :
>  
>  QueryException: [Syntax Error] line 0, col 474: Error: Expected 
> Doctrine\ORM\Query\Lexer::T_AND, got '00' 
>
>  Anyone can help you can give some suggestion.
>
>              $formato = 'Y-m-d';
>             $_in = \DateTime::createFromFormat($formato, $in);
>             $dateIn = $_in->format('Y-m-d 00:00:00');
>             $_out = \DateTime::createFromFormat($formato, $out);
>             $dateOut = $_out->format('Y-m-d 00:00:00');
>             
>            return $query = "and p.pedData BETWEEN $dateIn and $dateOut";
>  
>      /**
>      * @var \DateTime $pedData
>      *
>      * @ORM\Column(name="PED_DATA", type="datetime", nullable=false)
>      */
>     private $pedData;
>  
>      public function setPedData(\DateTime $pedData) {
>         $this->pedData = $pedData;
>     }
>  
>  ...... and p.pedFinanceiro in (1) and p.pedData BETWEEN 2014/01/01 
> 00:00:00 and 2014/03/06 00:00:00 
>  
>  You are missing quotes around the dates in the DQL.
>
> and anyway, you should not use string concatenation (or string 
> interpolation) to put the dates in the DQL. you should use query parameters
>
> -- 
> Christophe | Stof
>
> 

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to