Jump to content

Ascending or descending date in pagination


iNoob

Recommended Posts

Hello guys. So I have a pagination that displays games from different categories. For example if I click the 'Skills Games' link, it will display only skill games from my database in the pagination results. However I have noticed that the newer games I add to my database, don't show up first in the list in the pagination results. So I added the fldDate column in my database to add the date the game was added to the database and fetch the date from the new skill games I added to the database by ascending or descending the fldDate column in the pagination results. I am trying to figure out how to fetch the current date of the new games I added and display them first in the pagination once the user clicks on 'Skills Games' link.

 

I have a pagination script that I need to Ascend or Descent depending on the date.

 

This is what I have as query

 

$query = "select distinct fldCategory from games order by fldCategory";

 

I was thinking maybe to fetch the date by doing this:

 

$query = "select distinct fldCategory from games order by fldCategory ORDER BY fldDate desc";

 

Would this be correct?

Link to comment
Share on other sites

It's not echo, the line you posted does not work atleast in my dev environment(?) You have twice there ORDER BY in the clause. Did you try it out?

yeah you're right it was a typo, I meant to write what you did.. im sorry  :'(

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.