www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to make an on click ascend descend php table

  1. #1
    Join Date
    Oct 2007
    Posts
    41

    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?

  2. #2
    Join Date
    Jul 2007
    Location
    Cracow
    Posts
    78
    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

  3. #3
    Join Date
    May 2008
    Posts
    6
    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

  4. #4
    Join Date
    Oct 2007
    Posts
    41
    Quote Originally Posted by mastorak
    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
    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
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles