ChiBuki
New Member
- Messages
- 11
- Reaction score
- 0
- Points
- 0
Hi! I want to try something new with this table.
By default it's sorted by ID descending. The command:
I want to make the table headers to be clickable. When I click on "Character", the table should be sorted by the character's name alphabetically. When I click on "Last Updated", the table should be sorted by the last updated date, and so on.... And when I click on "Average", the table should be sorted from the highest number to lowest; but when I click on "Average" again, it would sort from lowest to highest.
Basically I want it to be exactly like this, where you can have the list sorted by whatever is clicked in the table header.
How do I make my table be like that using PHP?
I didn't have luck with finding tutorials on Google, probably because I don't know the keyword/term for it. Thanks. :happysad:
By default it's sorted by ID descending. The command:
PHP:
$query = "SELECT ID, FeaturedCharacter, Rank, Average, TotalVotes, FivePoints, FourPoints, ThreePoints, TwoPoints, OnePoints, DateUpdated, Poll FROM TsundereOrNot ORDER BY ID DESC LIMIT $offset, $rowsPerPage";
I want to make the table headers to be clickable. When I click on "Character", the table should be sorted by the character's name alphabetically. When I click on "Last Updated", the table should be sorted by the last updated date, and so on.... And when I click on "Average", the table should be sorted from the highest number to lowest; but when I click on "Average" again, it would sort from lowest to highest.
Basically I want it to be exactly like this, where you can have the list sorted by whatever is clicked in the table header.
How do I make my table be like that using PHP?
I didn't have luck with finding tutorials on Google, probably because I don't know the keyword/term for it. Thanks. :happysad: