I built a switch to change the order of ascending and descending a sort, the $_GET['sense'] is the way it should be sorted, when it is ASC, the next time $sorting should be DESC ( I pass this to a function to add this to a url). However it never changes from DESC to ASC. I can't figure out why.
The important statement is the if($sorting) :
I want to say if the variable is ASC it should be DESC, if it is anything else (DESC hopefully) then it should be ASC again. But this doesn't seem to work.
if(isset($_GET['column']) && isset($_GET['sense'])){
$sorting = antiInjectie($_GET['sense']);
$temp = antiInjectie($_GET['column']);
if($sorting = "ASC"){
$sorting = "DESC";
}else{
$sorting = "ASC";
}
if(tableNameMatcher($temp)){
$order = $temp;
}
}else{
$order = "naam,voornaam";
$sorting = "ASC";
}
note The second else statement is for when there isn't anything given