Re: Re: Sort Order Description
| From: | kc68 at cornell dot edu | Date: | Fri, 12 Mar 2004 00:50:27 +0000 |
| Subject: | Re: Re: Sort Order Description | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33409@lists.php.net to get a copy of this message | ||
I'm not clear on your question. The code I quoted, set forth below, has the text that ends up above the table. The following introduces the series of column headings with sort statements (of which the initial code is one):
# write out title
if ($sort_order == "asc") {$sort_title = "Ascending";} else {$sort_title = "Descending";}
echo "<p><b>Data Set Sorted By $sort_field in $sort_title Order</b></p>\n";
# write out table heading
echo "<table width='75%' border='1' cellspacing='0' cellpadding='0' align='center' bgcolor='#CCCC99'>\n";
echo "<tr>\n";
The following is at the beginning of the script:
# get sort order (if any) passed to script
$sort_field = $_REQUEST['sort_field'];
if (! $sort_field) {$sort_field = "(ssa1202.total/vapall.vapall)*100";}
$sort_order = $_REQUEST['sort_order'];
if (! $sort_order) {$sort_order = "desc";}
Thanks.
****************
On 12 Mar 2004 00:12:41 -0000, David Robley <robleyd@ozemail.com.au> wrote:
kc68@cornell.edu wrote in news:opr4pq3cqowxq73o@smtp.comcast.com:How can I have the explanation above a php table on a sort come out as something different than the sort coding? For example, the sort line below results in the following text above the sorted table: "Data Set Sorted by (ssa1202.total/vapall.vapall)*100 in Descending Order". I'd prefer simply "Data Set Sorted by Percent in Descending Order." I tried naming the sort field "as Percent" but that didn't change anything. echo "<td><div align='center'><font size='3'><b>Percent<a href='ssa1202.php?sort_field=(ssa1202.total/vapall.vapall)*100&sort_ord er=desc' target='_self'><font size='2'><br>Sort</a></b></font></div></td>\n"; KenWithout seeing the code that produces the text above the table, its a bit hard to give any suggestions.