/    Sign up×
Community /Pin to ProfileBookmark

How to make an on click ascend descend php table

Im trying to make a sortable table for displaying websites, their ranking, language…. but keep coming into problems with the javascript ones available conflicting with things on my site. Is there a way I can do the same thing with php? I just need 5 columns that i can ascend or descend a-z z-a and everything would be with letters no numbers. and 1 column of images. (rating system)

Has anyone made anything like this?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@malarzMay 11.2008 — PHP has nothing to do with onClick, but you can do a link with GET parameter telling script to sort ascending or descending, if you want to sort it without reloading page you must do the sorting via js or retrieve sorted list via AJAX and rebuild table - first one is much less nerve-making ?
Copy linkTweet thisAlerts:
@mastorakMay 11.2008 — If you are using an SQL database in your backend server system you can easily archive that with using different database queries. On your table buttons will call the different quires and your data will come back sorted.

for example you could do something like

select * from websites order by rank;

which will return all the db entries sorted by the value on column rank

for a guide on php database handling you can look here

personally I use displayTag as my main table handling component but it is for java-based web applications.


Website creation guides
Copy linkTweet thisAlerts:
@torrentsauthorMay 12.2008 — If you are using an SQL database in your backend server system you can easily archive that with using different database queries. On your table buttons will call the different quires and your data will come back sorted.

for example you could do something like

select * from websites order by rank;

which will return all the db entries sorted by the value on column rank

for a guide on php database handling you can look here

personally I use displayTag as my main table handling component but it is for java-based web applications.


Website creation guides[/QUOTE]

Thanks Im checking the database journal link now.

PHP has nothing to do with onClick, but you can do a link with GET parameter telling script to sort ascending or descending, if you want to sort it without reloading page you must do the sorting via js or retrieve sorted list via AJAX and rebuild table - first one is much less nerve-making
[/QUOTE]

I dont mean the onclick command, I mean on mouse click the link you click on makes the table ascend or descend. From A to Z then after another click from Z to A.
×

Success!

Help @torrents spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...