Commit 49cb9931 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add an "order by" clause to sort by pid,eid in lists.

parent ec134951
......@@ -17,7 +17,8 @@ LOGGEDINORDIE($uid);
#
$query_result = mysql_db_query($TBDBNAME,
"select e.pid,eid,expt_name from experiments as e ".
"left join proj_memb as p on p.pid=e.pid where p.uid='$uid'");
"left join proj_memb as p on p.pid=e.pid where p.uid='$uid' ".
"order by e.pid,eid");
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no experiments running in any of the projects ".
......
......@@ -20,12 +20,13 @@ $isadmin = ISADMIN($uid);
#
if ($isadmin) {
$query_result = mysql_db_query($TBDBNAME,
"select pid,eid,expt_name from experiments");
"select pid,eid,expt_name from experiments order by pid,eid");
}
else {
$query_result = mysql_db_query($TBDBNAME,
"select e.pid,eid,expt_name from experiments as e ".
"left join proj_memb as p on p.pid=e.pid where p.uid='$uid'");
"left join proj_memb as p on p.pid=e.pid where p.uid='$uid' ".
"order by e.pid,eid");
}
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no experiments to ".
......
......@@ -28,11 +28,11 @@ $isadmin = ISADMIN($uid);
#
if ($isadmin) {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects");
"SELECT * FROM projects order by pid");
}
else {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects where head_uid='$uid'");
"SELECT * FROM projects where head_uid='$uid' order by pid");
}
if (! $query_result) {
$err = mysql_error();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment