[PHP-DB] Re: Sort Order Description

2004-03-11 Thread David Robley
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]:

 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 tddiv align='center'font size='3'bPercenta 
 href='ssa1202.php?sort_field=(ssa1202.total/vapall.vapall)*100sort_ord
 er=desc' target='_self'font
 size='2'brSort/a/b/font/div/td\n; 
 
 Ken
 

Without seeing the code that produces the text above the table, its a bit 
hard to give any suggestions.

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



Re: [PHP-DB] Re: Sort Order Description

2004-03-11 Thread kc68
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 pbData 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='#99'\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 -, David Robley [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]:

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 tddiv align='center'font size='3'bPercenta
href='ssa1202.php?sort_field=(ssa1202.total/vapall.vapall)*100sort_ord
er=desc' target='_self'font
size='2'brSort/a/b/font/div/td\n;
Ken

Without seeing the code that produces the text above the table, its a bit
hard to give any suggestions.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: Sort Order Description

2004-03-11 Thread Bruno Ferreira
[EMAIL PROTECTED] wrote:

[snip...]

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;}


   First things first. That code (it seems to me) is vulnerable to SQL 
injection. Better fix that first...

   Bruno Ferreira
---
[This E-mail scanned for viruses by Declude Virus]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php