garfield11
IS-IT--Management
Hi all,
Can anyone pls help me with this:
I got this codes "orderby" whereby when user clicks User Name (header) it will order by user name ASC.
Title: View Users
User Name (header) <-- when click, oderby
ABC
DEF
GH
Eh how can i reverse sort, means i clicks once, orderby ASC, click again, orderby DESC...
<%
String orderby= request.getParameter("orderby"
PreparedStatement stmt = conn.prepareStatement("Select * from users, department, userGroup where users.deptID = department.deptID and users.userGroupID = userGroup.userGroupID order by ?"
stmt.setString(1, orderby);
ResultSet rs=stmt.executeQuery();
%>
<a href="viewUser.jsp?orderby=userName">User Name</a>
Thanks.
Can anyone pls help me with this:
I got this codes "orderby" whereby when user clicks User Name (header) it will order by user name ASC.
Title: View Users
User Name (header) <-- when click, oderby
ABC
DEF
GH
Eh how can i reverse sort, means i clicks once, orderby ASC, click again, orderby DESC...
<%
String orderby= request.getParameter("orderby"
PreparedStatement stmt = conn.prepareStatement("Select * from users, department, userGroup where users.deptID = department.deptID and users.userGroupID = userGroup.userGroupID order by ?"
stmt.setString(1, orderby);
ResultSet rs=stmt.executeQuery();
%>
<a href="viewUser.jsp?orderby=userName">User Name</a>
Thanks.