hi everyone , 
i want to translate some SQL statement to DQL any help ? 
i have user entity 
-------user--------
id 
username
email
password 
...
--------------------
and a friend entity wich have 2 attribute friend_one and friend_two who 
reference to user 
------friend---- 
id 
friend_one
friend_two
statu
--------------

so my SQL statement are :

*UPDATE* *friend*
*SET* status="1"
*WHERE *
(friend_one="*$user_id*" OR friend_two="*$user_id*") 
*AND *
(friend_one="*$friend_id*" OR friend_two="*$friend_id*");

--------------

*SELECT* 'friend_one','friend_two','status' *FROM* *friend*
*WHERE*
(friend_one="*$user_id*" OR friend_two="*$user_id*")
*AND*
(friend_one="*$friend_id*" OR friend_two="*$friend_id*")

--------

*SELECT* *F*.statu, *U*.username, *U*.id
*FROM* *user **U*, *friend* *F*
*WHERE*
*CASE*

*WHEN* *F*.friend_one = '*$user_id*'
*THEN* *F*.friend_two = *U*.user_id
*WHEN* *F*.friend_two= '*$user_id*'
*THEN* *F*.friend_one= *U*.user_id
*END*

*AND *
*F*.statu='1'; 



any help ?? :/ 




-- 
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 https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to