A
A
aidarov012018-06-09 13:45:03
PHP
aidarov01, 2018-06-09 13:45:03

How to implement data output of the database with sorting?

Guys how to implement the data output of the database with sorting.
For example:
I select from the drop-down list to display data by popularity, by genre, by year, and by country.
But before sorting, all data should be displayed.
If it's not difficult, write a code example)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2018-06-09
@ThunderCat

I choose from the dropdown list to display data by popularity, by genre, by year, and by country.

As they wrote in the comments - ORDER BY `sort_field`
you can simply not specify the sorting method, but then you will have everything in a bunch, there will be no intelligible output order. And btw - sorting will not affect the output of all / not all data, there are other operators for this - LIMIT, WHERE, etc.
not difficult, but:
firstly, it is prohibited by the rules of the resource (you could also read the conditions when submitting a question),
secondly, your implementation will not specifically fit someone else's code, no one except you knows either the data storage structure in your database, or code that handles all of this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question