SHOW:
|
|
- or go back to the newest paste.
1 | - | if($_GET['order'] == 'ASC') |
1 | + | switch ($_GET['order']) { |
2 | - | { |
2 | + | case 'DESC': |
3 | - | $orderby = 'name ASC'; |
3 | + | $orderby = 'DESC'; |
4 | - | } |
4 | + | break; |
5 | - | else if($_GET['order'] == 'DESC') |
5 | + | case 'ASC': |
6 | - | { |
6 | + | default: |
7 | - | $orderby = 'name DESC'; |
7 | + | $orderby = 'ASC'; |
8 | - | } |
8 | + | } |
9 | - | else |
9 | + | |
10 | - | { |
10 | + | $query = "SELECT * FROM tabelle WHERE 1=1 ORDER BY name $orderby LIMIT 25"; |