Jump to content

Archived

This topic is now archived and is closed to further replies.

mcmuney

OR function

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.