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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.