You need to reverse more than just the comparison:
SELECT adid
FROM table
WHERE adid < $current_adid
ORDER BY adid DESC
LIMIT 1;
The ORDER BY
direction also needs to be reversed.
You could also replace these with:
SELECT MIN(adid)
FROM table
WHERE adid > $current_adid;
SELECT MAX(adid)
FROM table
WHERE adid < $current_adid;
The aggregation functions might make the logic clearer.