View Single Post
Old 03-14-2003, 08:05 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
mixing AND & OR in an sql statement

i'm having trouble mixing AND & OR in an SQL query.

how would i do this:
Code:
select game_id from tictactoe where winner IS NOT NULL and p1_id='$userid' or p2_id='$userid' order by game_id desc limit 10
i need it to select a row where the winner is not null, .. but either p1_id or p2_id can equal $userid

this doesn't work for some reason
sde is offline   Reply With Quote