Problem with ORDER BY [ASC | DESC]

0

Good afternoon,

I have a problem with the ORDER BY that I can not understand why it does not work, and it's probably stupid, but I can not find the stupidity.

I have this query:

SELECT * FROM webla_solicitudinfo ORDER BY 'IDSolicitud' ASC

I have tried to set IDSplication without the '', I tried changing ASC by DESC to see if I noticed any change, but nothing.

My intention is to list a database of Information Requests in order of arrival, being the last to arrive at the top of the list. For that reason I order them by the ID of the request, but it does not filter it.

Pepe Gordillo should go first, being the last to request information.

This is the BD:

    
asked by Charlie Clewer 21.09.2017 в 17:49
source

2 answers

0

The problem was in the Datatables plugin that automatically filtered by date in an ASC manner. I changed the filter by DESC adding the following part of code in the tag

data-order='[[ 1, "desc" ]]'
    
answered by 21.09.2017 / 18:15
source
1
SELECT * FROM webla_solicitudinfo ORDER BY IDSolicitud DESC;

If you use php tb you can go through the array that returns the query from the last element to the first to show it, or to make a sort, there are many variants

    
answered by 21.09.2017 в 18:08