Jump to content

Sort by Date


AlbumFiend

Recommended Posts

Hey I'm new here, just signed up, and was hoping to get some help implementing some features into this PHP script. I didn't personally code it and I'm almost brand new when it comes to coding in PHP.

 

Basically my table is set up so that it has a date header and each item listed has their date added attached. I was hoping to be able to make the date header clickable so it would sort the information already in the table by date.

 

I found this on another forum when looking it up:

select * from table order by datecolumn desc 

But I'm not sure how to implement it  :shrug:

Link to comment
https://forums.phpfreaks.com/topic/169985-sort-by-date/
Share on other sites

The * selects all information in every field.

 

Table needs to be changed to the name of the table you want to get the information from.

 

after ORDER BY you place the field name you want to have the information sorted by.

 

DESC will place the results in descending order.

 

Hope that helps.

Link to comment
https://forums.phpfreaks.com/topic/169985-sort-by-date/#findComment-896828
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.