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)
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
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.
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.
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
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.
Bookmarks