Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7956573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:02:16+00:00 2026-06-04T04:02:16+00:00

I have a database where, on the admin side, the admin enters football players

  • 0

I have a database where, on the admin side, the admin enters football players and their stats for a fantasy football site.

On the front end, users see a tabbed interface (a tab for each position with the relevant players and stats under that tab).

Currently I set the default ORDER BY when I display the results, like this:

$result = mysql_query("SELECT Player, Team, Pass_Yds, Pass_TDs, Int_Thrown, Rush_Yds, Rush_TDs, Overall_Pts, Total_Fantasy_Pts FROM ff_projections WHERE Position = 'QB' ORDER BY Pass_Yds DESC;");

I want to add a Sort By drop down so that the viewer can change how the data is sorted (e.g. if they wanted to sort the quarterback results in order of the most passing touchdowns (Pass_TDs).

How would I go about doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:02:17+00:00Added an answer on June 4, 2026 at 4:02 am

    Rather than allow the user to POST a form to change the sort on the server, I recommend allowing the user to simply re-sort on the client. After all, the user already has all of the data delivered to them. There’s no need to post back to the server again and again for the same data just to sort it.

    Take a look at jqGrid, for example. You can load your data into that and let it handle the sorting for you (as well as paging, filtering and search, etc. if you want). Tablesorter is another one. And there are many others. (A Google search for something like “jQuery sortable table” will yield a lot of results.)

    This would present a better user experience and at the same time reduce the load of the application, since you would only have to deliver the same data to the user once instead of multiple times. Often it’s also a simpler approach because it helps separate the manipulation of the display from the fetching of the data. So your server-side code can stay clean and simple and not have to concern itself with client-side things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our website uses a PHP front-end and a PostgreSQL database. We don't have a
I have a user database which I want the admin to be able view
I have Database with date field. I see the time like: 1900-01-01 13:38:00.000 How
My admin folks have encountered a big problem, and I'm relaying their plight to
I have a simple admin database. I want to port it to search and
I have created a Sample Module (Admin Side) in Magento.. I managed To created
I'm not a database admin or architect, so I have to ask those who
I have database with multiple tables in Microsoft SQL Server with schema in tables
i have database with two values id and val so i want to ask
I have database application, I want to allow the user to restore the deleted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.