I don't think you need the last ELSE in the ELSEIF statement. I am fairly new to the PHP game, but I used the following code which worked fine:
if (empty($sortby)) {
echo "You have not selected a correct link";
}
elseif ($sortby == 1) {
$tmporder = organisation;
}
elseif ($sortby == 2) {
$tmporder = salary;
}
elseif ($sortby == 3) {
$tmporder = date_created;
}
That all seemed to work ok!! Hope this helps!!