When I tried the code and refreshed my browser I got this error:

Parse error: syntax error, unexpected T_VARIABLE

On this line:

$q = Doctrine_Query::create()


Any ideas on what the problem is?

Thanks Michal

On Oct 20, 12:06 pm, Michał Piotrowski <[email protected]> wrote:
> This should do the trick
>
> $product_type = 'bracelet'
>
> $q = Doctrine_Query::create()
> ->from('Product p')
> ->where('p.product_type = ?', $product_type);
>
> $result = $q->count();
>
> 2010/10/20 xpanshun <[email protected]>:
>
>
>
>
>
>
>
> > Sorry, I also forget to mention that in DQL, I ultimately want to get
> > an actual count (i.e. 0, 1, 2, etc.) of the rows where this query
> > holds true.
>
> > On Oct 20, 10:35 am, xpanshun <[email protected]> wrote:
> >> Hi all,
>
> >> How can I code the following SQL query in DQL for my Symfony project?
>
> >>           SELECT * FROM product WHERE product_type = 'bracelet'
>
> >> Thanks in advance!
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to 
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to