PHP SQL help

I am trying to create a sql statement that will select all records EXCEPT for certain content ID that I will manually specify. I’m a newbie to PHP so not sure what the correct SQL statement would be : lmow it would be something like

“SELECT contentId, contentName,contentText, contentDisplay FROM content WHERE contentDisplay='Yes”…Need this bit to be where contentID is not equal to 1, 2, 3 etc "

Any help would be appreciated.

Cheers

you could try
SELECT * FROM content WHERE contentDisplay != '2' where 2 is the row is the one you DONT want to display

you could try
SELECT * FROM content WHERE contentDisplay != '2' where 2 is the row is the one you DONT want to display

SELECT contentId, contentName,contentText, contentDisplay FROM content WHERE contentDisplay='Yes' AND contentID NOT IN (1, 2, 3, 4, 5)

You could just seperate the ID’s that you don’t want with commas and use the NOT IN listing.

if I want to add more thant one row would it be =

!= ‘2’,‘3’.‘4’

or

!= ‘2,3,4’

Cheers for fast reply

[QUOTE=opel;1985106]if I want to add more thant one row would it be =

!= ‘2’,‘3’.‘4’

or

!= ‘2,3,4’

Cheers for fast reply[/QUOTE]

sorry skoob never saw your reply. Seem to be having problems wit the board it is missing out topics and making me log in every time I want to see a page.

did that work for you then?

I’m at work at the moment I’ll try it over next couple of days when I get a chance and let you know. Thanks.

sk00b’s NOT IN method is the answer.

I was guessing with the !=

!= will work if you only want to exclude one value (at a time).