Ok, thx Tom.

On 17 Kwi, 15:51, Tom Boutell <[email protected]> wrote:
> This belongs on the doctrine-users list. This list is for discussion
> of the future development of Symfony itself.
>
> http://groups.google.com/group/doctrine-user
>
> I think you're probably having difficulty with the order of
> operations. Use DQL in a single where clause instead and use explicit
> parentheses in DQL to make sure you say what you really mean.
>
>
>
> On Sat, Apr 17, 2010 at 7:05 AM, berni <[email protected]> wrote:
> > I`am using doctrine (1.2) in my project. Dql query for generating the
> > problem is:
>
> >  public static function login( $email, $password )
> >  {
>
> >    $q = Doctrine_Query::create()
> >        ->from('Users u')
> >        ->where('u.email = ?', $email)
> >        ->orWhere('u.nick = ?', $email)
> >        ->andWhere('u.password = ?', md5( $password ) )
> >        ->andWhere('u.active = ?', 1 ) ;
>
> >    return $q->fetchOne();
> > }
>
> > When request contains email address work fine but when request
> > constains nick then method fetchOne() return false! Why? For control i
> > use getSql() method which return raw sql
>
> > SELECT * FROM users u WHERE u.email = ? OR u.nick = ? AND u.password
> > = ? AND u.active = ?
>
> > (I replace fields name on star for better readability)
>
> >  I copy this sql in my pgsql console and run this code ... and work!
>
> > Where is problem?
>
> > --
> > 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 developers" 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-devs?hl=en
>
> --
> Tom Boutell
> P'unk Avenue
> 215 755 1330
> punkave.com
> window.punkave.com
>
> --
> 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 developers" 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 
> athttp://groups.google.com/group/symfony-devs?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 developers" 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-devs?hl=en

Reply via email to