D
D
darknet372017-05-02 22:02:16
Yii
darknet37, 2017-05-02 22:02:16

How to exclude to make a selection from the bottom of the database of all records, except for one record?

Good evening. I have a problem, how to exclude to make a selection from the bottom of the database of all records, except for one record?
I have an open post page and under it I need to display posts from the same category.
I can make it so that only all posts are displayed, but how can I make it so that everything is displayed except for the one that is open (at the moment I'm on it right now)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2017-05-02
@darknet37

SELECT `field1`, `field2` FROM `table` WHERE `id` <> 5

Selects all records from the table `table` that have an id not equal to 5. You must substitute here the id of the category that is open.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question