Forum Moderators: coopster

Message Too Old, No Replies

Problem with PHP mysql query

         

ajs83

3:11 am on Jan 12, 2006 (gmt 0)

10+ Year Member



I'm try to get a query to work that selects item based on one of three names, when I want to pull up just the
names using the query below it works

SELECT *
FROM
`names`
WHERE
`first` = 'Bob' OR
`first` = 'Tom' OR
`first` = 'Jim'

but when I switch it around and try to pull up every EXCEPT those three names using the!=/NOT LIKE commands, it does not work

SELECT *
FROM
`names`
WHERE
`first`!= 'Bob' OR
`first`!= 'Tom' OR
`first`!= 'Jim'

What is the correct query to use?

niels

3:18 am on Jan 12, 2006 (gmt 0)

10+ Year Member



SELECT *
FROM
`names`
WHERE
`first`!= 'Bob' AND
`first`!= 'Tom' AND
`first`!= 'Jim'

I hope that works