-7

I'm trying to SELECT from usr_uploaded_content WHERE the id is NOT equal to $content_id I'm just wondering how this could be achieved. Thankyou.

 SELECT * FROM `usr_uploaded_content` WHERE `id` != '$content_id' LIMIT 2

In this example I used the != to demonstrate the not equal.

2 Answers2

3

Try <>. See Here for more detail

SELECT * FROM `usr_uploaded_content` WHERE `id` <> '$content_id' LIMIT 2
Community
  • 1
  • 1
Vinie
  • 2,983
  • 1
  • 18
  • 29
1
SELECT * FROM `usr_uploaded_content` WHERE `id` <> '$content_id' LIMIT 2
Stivan
  • 1,128
  • 1
  • 15
  • 24