mcmuney Posted September 28, 2006 Share Posted September 28, 2006 When I add OR function to this query, it doesn't work, what am I doing wrong?ORIGINAL[code] $sel_image="select scm_mem_id,sci_url FROM sc_member_images WHERE sci_slogan<>'M' ORDER BY sci_id DESC";[/code]WITH OR STATEMENT[code] $sel_image="select scm_mem_id,sci_url FROM sc_member_images WHERE (sci_slogan<>'M' OR sci_slogan<>'D') ORDER BY sci_id DESC";[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted September 28, 2006 Share Posted September 28, 2006 I believe you really mean[code]WHERE (sci_slogan<>'M' AND sci_slogan<>'D')[/code]or[code]WHERE sci_slogan NOT IN ('M', 'D')[/code]NOT (M OR D) = NOT M AND NOT D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.