MYSQL Help - Quick Query

Associate
Joined
19 Mar 2005
Posts
569
Hi there just a quickbit of help needed

I am currently trying to display records where p2ConfirmResult contains 1 and player1ID or player2ID contains a $username.

Here is my pseudo code below, I know you cant use OR.

Code:
WHERE p2ConfirmResult = 1 AND player1ID OR player2ID = '$username'";

Just wondering how i could do this.

Leon
 
not 100% sure but expand the player1 and player2 OR into 2 seperate conditions in brackets:
Code:
WHERE p2ConfirmResult = 1 AND (player1ID = '$username' OR player2ID = '$username')";
 
Works a treat mate cheers
thumbs_up.gif


Thanks
 
Back
Top Bottom