Let's see:
?
$dir = ((isset ($_GET['dir'])) ? (int) $_GET['dir'] : 1);
if (!$dir)
$direction = 'desc';
$dir = ($dir ? 0 : 1);
?
tda href=default2.php?orderBy=?=$colname?dir=?= $dir?Last
Name/a/td
This is the general idea. $dir will toggle between 1 and 0. There are
more compact ways
well i tried that..
but it out puts the right number.
but it is not taking that var to switch ACS or DESC...
http://localhost/php/default2.php?orderBy=priLastNamedir=0
http://localhost/php/default2.php?orderBy=priLastNamedir=1
/* here we set up out order by clause */
$orderBy = 'priLastName';
On Saturday 09 November 2002 00:26, Paul Ihrig wrote:
well i tried that..
but it out puts the right number.
but it is not taking that var to switch ACS or DESC...
http://localhost/php/default2.php?orderBy=priLastNamedir=0
http://localhost/php/default2.php?orderBy=priLastNamedir=1
/* here
I think you might be missing a = sign in your if statement.
Marco
-
php|architect -- The Monthly Magazine For PHP Professionals
Come visit us on the web at http://www.phparch.com!
On Fri, 2002-11-08 at 11:26, Paul Ihrig wrote:
well i tried that..
but it out puts the right
Thanks Guys..
This seemed to do the trick
/* and the desc asc */
$dir = ((isset ($_GET['dir'])) ? (int) $_GET['dir'] : 1);
if (!$dir)
$dir = ($dir ? 0 : 1);
if ($HTTP_GET_VARS['dir'] == 0) {
$diri = 'DESC';
}
if ($HTTP_GET_VARS['dir'] == 1) {
$diri = 'ASC';
}