eskimopest eskimopest - 7 months ago 72
MySQL Question

PHP SQL pagination by name

I'm making a website with my movies and am trying to make the pagination by last id, date, views, and rating.

I can easily make the pagination by last id just by querying the database

FROM movies
ORDER BY movie_id DESC

then, with php make the pagination.

Now, my question is how to make it list by the other options? i can make it work with xml files but would like to know if there is a way to do this with a simple query.

my movie looks like this:

movie_id movie_title movie_subtitle movie_desc movie_data movie_views movie_rating

Thanks in advance.


simple query will be the best and easy solution write a query with required where clause and then just appy the limit and offset values.