Two Column Sort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm re-raising an issue I never quite resolved which has become more critical. I want to sort a table on two columns. There are about 440 rows of which about 400 are blank in the first sort column (CBC); the other rows show B in that column. When I use the coding below, the two column sort takes place but the rows designated B are at the bottom of the (long) table and I want them at the top. Neither asc nor desc accomplishes this (just reverses the second factor order, still at the bottom below the blanks).

Here's the php code for the sort command:

echo "<td><div align='center'><font size='3'><b>CBC <a
href='contributions22504.php?sort_field=cbc, net_receipts&sort_order=desc'
target='_self'><font size='2'>Sort</a></b></font></div></td>\n";

Here's the basic setup that begins the script:

# get sort order (if any) passed to script
$sort_field = $_REQUEST['sort_field'];
if (! $sort_field) {$sort_field = "State";}
$sort_order = $_REQUEST['sort_order'];
if (! $sort_order) {$sort_order = "asc";}

Thanks in advance.

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux