Page 2 of 2

Re: ORDER BY $sortby, .... not showing in correct order...

Posted: Fri Oct 28, 2016 10:05 am
by Celauran
simonmlewis wrote:Ok two issues.
1) at what point does it store the content of the variables that have been passed through the URL?
Not clear what you're asking here.
simonmlewis wrote:2) how do I clear the variable if I want to reset, using the powered=showall in the URL?

Code: Select all

if(isset($_GET['powered']))
{
    $query_params['powered'] = $_GET['powered'];
    if ($powered == "showall") { $query_params['powered'] = NULL;}
    $_SESSION['powered']=$powered;
} elseif (isset($_SESSION['powered'])) {
    $query_params['powered'] = $_SESSION['powered'];
}
This doesn't do it.
$powered does not appear to even be defined. That aside, if $_GET['powered'] is 'showall' and you don't want to use that in your query, just unset the array key or don't set it in the first place.