J
J
JayDeeZz2017-12-07 19:57:03
CodeIgniter
JayDeeZz, 2017-12-07 19:57:03

How can I separately display the place that an article occupies, for example?

How to separately display the space that an article occupies for example in phpmyadmin?
What I did ..
I displayed a list of articles by sql rating with a query from higher to lower, for example
, 1st place article rating 10
2nd place article rating 9
3rd place article rating 8
4th place article rating 7
and I did it all in the table and numbered and so I find out which place it occupies but the numbering is not recorded anywhere.
I want the article itself to say that this article takes, for example, 3rd place in the ranking, but that this is all done automatically.
I think I explained everything clearly, please help)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KazeZlat, 2017-12-07
@KazeZlat

You need a nested query:

SELECT
  x.позиция
FROM ('Тот запрос, который выдает вам эту таблицу') x
WHERE x.статья = ID;

4
4iloveg, 2017-12-07
@4iloveg

Make a table to store the position of the article or add the field "place in the rating" to the table with the article and update it periodically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question